From d23d7d8270b6c601df44ba7edbdc1c2e6c8f2c7f Mon Sep 17 00:00:00 2001 From: "patrick.brugiere" Date: Sun, 19 Nov 2023 20:23:12 +0100 Subject: [PATCH] travail sur la vue du quiz --- Project/php/controller/AbsController.php | 3 + Project/php/templates/quizzView.html | 100 ++++++++++++++++++++--- 2 files changed, 92 insertions(+), 11 deletions(-) diff --git a/Project/php/controller/AbsController.php b/Project/php/controller/AbsController.php index 1ab18d3..72144db 100755 --- a/Project/php/controller/AbsController.php +++ b/Project/php/controller/AbsController.php @@ -102,4 +102,7 @@ abstract class AbsController shuffle($shuffle); echo $twig->render('quizzView.html', ['translations' => $allTranslation, 'randomtranslations' => $shuffle]); } + public function test(){ + echo "ça marche"; + } } \ No newline at end of file diff --git a/Project/php/templates/quizzView.html b/Project/php/templates/quizzView.html index e188dd4..f2d75fc 100755 --- a/Project/php/templates/quizzView.html +++ b/Project/php/templates/quizzView.html @@ -5,12 +5,12 @@ Manage groups -
+

Quiz

- +
{% if translations is defined %} {% for translation in translations %} -

{{ translation.word1 }}

+

{{ translation.word1 }}

{% set correctAnswer = translation.word2 %} {% if randomtranslations is defined %} {% set otherTranslations = [correctAnswer] %} @@ -19,19 +19,37 @@ {% set otherTranslations = otherTranslations|merge([randomtranslation.word2]) %} {% endif %} {% endfor %} - - - - {# Affichage des réponses sous forme de radio buttons #} +
+
{{ correctAnswer }}
+
{% for otherTranslation in otherTranslations %} - {{ otherTranslation }}
+ {{ otherTranslation }}
+ {% endfor %} + + +
+
+ {% endif %} {% endfor %} {% endif %} - - + {% if submitted %} {% if isCorrect %}

Correct answer!

@@ -54,4 +72,64 @@
- \ No newline at end of file + + \ No newline at end of file