@@ -44,11 +44,11 @@ protected function configure()
4444 $ this
4545 ->setName ('start ' )
4646 ->setDescription ('Starts a new question set ' )
47+ ->addArgument ('categories ' , InputArgument::IS_ARRAY , 'Which categories do you want (separate multiple with a space) ' , array ())
4748 ->addOption ('number ' , null , InputOption::VALUE_OPTIONAL , 'How many questions do you want? ' , 20 )
4849 ->addOption ('list ' , 'l ' , InputOption::VALUE_NONE , 'List categories ' )
4950 ->addOption ("training " , null , InputOption::VALUE_NONE , "Training mode: the solution is displayed after each question " )
50- ->addOption ('show-multiple-choice ' , null , InputOption::VALUE_OPTIONAL , 'Should we tell you when the question is multiple choice? ' , true )
51- ->addArgument ('categories ' , InputArgument::IS_ARRAY , 'Which categories do you want (separate multiple with a space) ' , array ())
51+ ->addOption ('hide-multiple-choice ' , null , InputOption::VALUE_NONE , 'Should we hide the information that the question is multiple choice? ' )
5252 ->addOption ('config ' , 'c ' , InputOption::VALUE_OPTIONAL , 'Use custom config ' , null )
5353 ;
5454 }
@@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9292 protected function askQuestions (Set $ set , InputInterface $ input , OutputInterface $ output )
9393 {
9494 $ questionHelper = $ this ->getHelper ('question ' );
95- $ showMultipleChoice = $ input ->getOption ('show -multiple-choice ' );
95+ $ hideMultipleChoice = $ input ->getOption ('hide -multiple-choice ' );
9696 $ questionCount = 1 ;
9797
9898 foreach ($ set ->getQuestions () as $ i => $ question ) {
@@ -102,12 +102,12 @@ protected function askQuestions(Set $set, InputInterface $input, OutputInterface
102102 $ questionCount ++,
103103 $ question ->getCategory (),
104104 $ question ->getQuestion (),
105- ($ showMultipleChoice === true ? "\n" .'This question <comment> ' .($ question ->isMultipleChoice () === true ? 'IS ' : 'IS NOT ' )."</comment> multiple choice. " : " " )
105+ ($ hideMultipleChoice === true ? "" : " \n" .'This question <comment> ' .($ question ->isMultipleChoice () === true ? 'IS ' : 'IS NOT ' )."</comment> multiple choice. " )
106106 ),
107107 $ question ->getAnswersLabels ()
108108 );
109109
110- $ multiSelect = $ showMultipleChoice === true ? $ question ->isMultipleChoice () : true ;
110+ $ multiSelect = true === $ hideMultipleChoice ? true : $ question ->isMultipleChoice ();
111111 $ numericOnly = 1 === array_product (array_map ('is_numeric ' , $ question ->getAnswersLabels ()));
112112 $ choiceQuestion ->setMultiselect ($ multiSelect );
113113 $ choiceQuestion ->setErrorMessage ('Answer %s is invalid. ' );
0 commit comments