diff --git a/Command/StartCommand.php b/Command/StartCommand.php index 2edb914..dda7530 100644 --- a/Command/StartCommand.php +++ b/Command/StartCommand.php @@ -45,6 +45,7 @@ protected function configure() ->setDescription('Starts a new question set') ->addOption('number', null, InputOption::VALUE_OPTIONAL, 'How many questions do you want?', 20) ->addOption('list', 'l', InputOption::VALUE_NONE, 'List categories') + ->addOption("training", null, InputOption::VALUE_NONE, "Training mode: the solution is displayed after each question") ->addOption('show-multiple-choice', null, InputOption::VALUE_OPTIONAL, 'Should we tell you when the question is multiple choice?', true) ->addArgument('categories', InputArgument::IS_ARRAY, 'Which categories do you want (separate multiple with a space)', array()) ; @@ -111,6 +112,15 @@ protected function askQuestions(Set $set, InputInterface $input, OutputInterface $set->setAnswer($i, $answers); + if($input->getOption("training")) + { + $uniqueSet = new Set(array($i => $question)); + + $uniqueSet->setAnswer($i, $answers); + + $this->displayResults($uniqueSet, $output); + } + $output->writeln('✎ Your answer: ' . $answer . "\n"); } }