Change printStrategy for multiple categories by question

AdminInterface
alexi 2 years ago
parent d7f02d5b0b
commit c6d8f400b7

@ -9,7 +9,7 @@
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
<component name="PhpProjectSharedConfiguration" php_language_level="8.1" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>

@ -30,7 +30,12 @@ class CheckBoxQuestion extends BoxQuestion
for($i = 0; $i < count($possibleResponses); $i++)
{
$html.= "<input type='checkbox' id='checkBoxQuestion' name='answers[]' value='$categories[$i]' />
$categoriesSplit = "_";
foreach ($categories[$i] as $category)
{
$categoriesSplit.= $category."_";
}
$html.= "<input type='checkbox' id='checkBoxQuestion' name='answers[]' value='$categoriesSplit' />
<label>$possibleResponses[$i]</label>";
}
$html.= "</div>";

@ -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.= "</form>
</div>";

@ -19,4 +19,3 @@
</body>
</html>

Loading…
Cancel
Save