getForm(); if(empty($form)) { return "PAS DE FORMULAIRE\n"; } $title = $form[0]['title']; $description = $form[0]['description']; $questionsTab = (new GatewayQuestion())->getAllQuestions($form[0]['id']); $questions = []; for($i = 0; $i < count($questionsTab[0]); $i++) { if(strcmp($questionsTab[0][$i]['type'], "BusinessClass\TextQuestion") == 0) { $questions[] = new TextQuestion($questionsTab[0][$i]['content'], $questionsTab[0][$i]['id']); } else { $possiblesResponses = $questionsTab[1][$i]; $content = $questionsTab[0][$i]['content']; $categories = $questionsTab[2][$i]; $id = $questionsTab[0][$i]['id']; $questions[] = new $questionsTab[0][$i]['type']($possiblesResponses, $content, $categories, $id); } } $html = "

$title

\n

$description

\n
\n
\n"; foreach ($questions as $question) { $html.= $question->printStrategy()."\n"; } $html.= "\t\t\t\n \t\t\t \t\t
\n \t
\n"; return $html; } }