From 1c64a43e069f9c1dc89bc5430d0f434588b7b001 Mon Sep 17 00:00:00 2001 From: "patrick.brugiere" Date: Sun, 19 Nov 2023 14:07:18 +0100 Subject: [PATCH] =?UTF-8?q?d=C3=A9but=20de=20travail=20sur=20le=20quizz=20?= =?UTF-8?q?et=20sur=20sa=20vue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project/php/controller/StudentController.php | 20 ++++++++++ Project/php/templates/quizContainer.twig | 14 +++++++ Project/php/templates/quizzView.html | 42 ++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100755 Project/php/templates/quizContainer.twig create mode 100755 Project/php/templates/quizzView.html diff --git a/Project/php/controller/StudentController.php b/Project/php/controller/StudentController.php index a218a5f..05a77be 100755 --- a/Project/php/controller/StudentController.php +++ b/Project/php/controller/StudentController.php @@ -2,8 +2,11 @@ namespace controller; use config\Validation; +use gateway\TranslationGateway; +use gateway\VocabularyListGateway; use model\MdlStudent; use Exception; +use model\Translation; class StudentController { @@ -82,4 +85,21 @@ class StudentController throw new Exception("invalid entries"); } } + public function quiz(): void { + global $twig; + $vocabId = $_GET['vocabID']; + $mdl = new TranslationGateway(); + $allTranslation = $mdl->findByIdVoc($vocabId); + echo $twig->render('quizzView.html', ['translations' => $allTranslation ]); + } +/* + public function flashcard(VocabularyList $v) { + $idVoc = $v->getId(); + $mdl = new TranslationGateway(); + $allTranslation = $mdl->findByIdVoc($idVoc); + while(1) { + + } + } +*/ } \ No newline at end of file diff --git a/Project/php/templates/quizContainer.twig b/Project/php/templates/quizContainer.twig new file mode 100755 index 0000000..085b974 --- /dev/null +++ b/Project/php/templates/quizContainer.twig @@ -0,0 +1,14 @@ + + + + {% if translations is defined %} + {% for row in translations %} + + + + + + + + +
{{ row.id }}{{ row.word1 }}{{ row.word2 }}{{ row.listVocab }}
\ No newline at end of file diff --git a/Project/php/templates/quizzView.html b/Project/php/templates/quizzView.html new file mode 100755 index 0000000..cbd9c81 --- /dev/null +++ b/Project/php/templates/quizzView.html @@ -0,0 +1,42 @@ + + + + + Manage groups + + + + + + + + + + + + + +
+

Quiz

+
+

{{frenchWord}}

+ + {% for i in 0..3 %} + + {{answers[i]}}
+ {% endfor %} + + +
+

Translator

+
+ + + +
+ +
+ + \ No newline at end of file