You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE4.01_FORMULAIRE/Source/Model/ModelCandidate.php

46 lines
1.5 KiB

<?php
namespace Model;
use BusinessClass\CheckBoxQuestion;
use BusinessClass\Form;
use BusinessClass\ListBoxQuestion;
use BusinessClass\TextQuestion;
use BusinessClass\YesNoQuestion;
class ModelCandidate
{
public function submitForm(): void
{
// TODO: Implement submitForm() method.
}
public function getForm(): string
{
/* TEMPORAIRE */
$title = "Formulaire de candidature à un témoignage";
$description = "Ce formulaire vous permet de candidater à un potentiel témoignage vidéo.";
$questions = array(
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"))
);
$form = new Form($title, $description, $questions);
/* ---------- */
$html = "<h1>$title</h1>
<h3>$description</h3>
<div id='container_form'>
<form>";
foreach ($questions as $question)
{
$html.= $question->printStrategy();
}
$html.= "</form>
</div>";
return $html;
}
}