From c6d8f400b7400fdc854004e0ca2d4a140e7851d0 Mon Sep 17 00:00:00 2001 From: alexi Date: Mon, 30 Jan 2023 17:11:07 +0100 Subject: [PATCH] Change printStrategy for multiple categories by question --- .idea/php.xml | 2 +- Source/BusinessClass/CheckBoxQuestion.php | 7 ++++++- Source/Model/ModelCandidate.php | 3 ++- Source/Views/HTML/form.php | 1 - 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.idea/php.xml b/.idea/php.xml index b2ca53c..639f74d 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -9,7 +9,7 @@ - + diff --git a/Source/BusinessClass/CheckBoxQuestion.php b/Source/BusinessClass/CheckBoxQuestion.php index 144f289..1e35392 100644 --- a/Source/BusinessClass/CheckBoxQuestion.php +++ b/Source/BusinessClass/CheckBoxQuestion.php @@ -30,7 +30,12 @@ class CheckBoxQuestion extends BoxQuestion for($i = 0; $i < count($possibleResponses); $i++) { - $html.= " + $categoriesSplit = "_"; + foreach ($categories[$i] as $category) + { + $categoriesSplit.= $category."_"; + } + $html.= " "; } $html.= ""; diff --git a/Source/Model/ModelCandidate.php b/Source/Model/ModelCandidate.php index 8d37369..492a8c0 100644 --- a/Source/Model/ModelCandidate.php +++ b/Source/Model/ModelCandidate.php @@ -24,7 +24,7 @@ class ModelCandidate new TextQuestion("Décrivez-nous votre parcours en quelques lignes :", array(null)), new YesNoQuestion("Êtes-vous originaire de Clermont et ses alentours ? (- de 2 heures de trajet)", array("Origine")), new ListBoxQuestion(array("BAC Général", "BAC Pro", "Étude supérieure"), "Quel étude avez-vous réalisé avant l'IUT?", array("Général", "Pro", "EtudSupp")), - new CheckBoxQuestion(array("Mathématiques", "Web", "Mobile", "Gestion"), "Quels matières appréciez-vous ?", array("Maths", "Web", "Mobile", "Gestion")) + new CheckBoxQuestion(array("Mathématiques", "Web", "Mobile", "Gestion"), "Quels matières appréciez-vous ?", array(array("Maths", "Maths2", "Maths3"), array("Web"), array(""), array("Gestion", "Gestion2"))) ); $form = new Form($title, $description, $questions); /* ---------- */ @@ -38,6 +38,7 @@ class ModelCandidate { $html.= $question->printStrategy(); } + $html.= " "; diff --git a/Source/Views/HTML/form.php b/Source/Views/HTML/form.php index 31d04aa..e064d33 100644 --- a/Source/Views/HTML/form.php +++ b/Source/Views/HTML/form.php @@ -19,4 +19,3 @@ -