|
|
@ -14,7 +14,7 @@ class VisitorController
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
$idVoc = Validation::filter_int($match['id'] ?? null);
|
|
|
|
$idVoc = Validation::filter_int($_POST['idVoc'] ?? 2);
|
|
|
|
$wordList = (new \gateway\TranslationGateway())->findByIdVoc($idVoc);
|
|
|
|
$wordList = (new \gateway\TranslationGateway())->findByIdVoc($idVoc);
|
|
|
|
$name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName();
|
|
|
|
$name = ((new \gateway\VocabularyListGateway())->findById($idVoc))->getName();
|
|
|
|
$wordShuffle = array();
|
|
|
|
$wordShuffle = array();
|
|
|
@ -47,7 +47,7 @@ class VisitorController
|
|
|
|
public function quiz($match): void
|
|
|
|
public function quiz($match): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
$vocabId = Validation::filter_int($match['id'] ?? null);
|
|
|
|
$vocabId = Validation::filter_int($_POST['idVoc'] ?? 4);
|
|
|
|
$vocabList = (new VocabularyListGateway())->findById($vocabId) ?? null;
|
|
|
|
$vocabList = (new VocabularyListGateway())->findById($vocabId) ?? null;
|
|
|
|
if ($vocabList == null) throw new Exception("liste inconnue");
|
|
|
|
if ($vocabList == null) throw new Exception("liste inconnue");
|
|
|
|
$mdl = new TranslationGateway();
|
|
|
|
$mdl = new TranslationGateway();
|
|
|
@ -115,7 +115,7 @@ class VisitorController
|
|
|
|
|
|
|
|
|
|
|
|
public function resultatsJeux($match): void{
|
|
|
|
public function resultatsJeux($match): void{
|
|
|
|
global $twig;
|
|
|
|
global $twig;
|
|
|
|
$score = Validation::filter_int($match['id']);
|
|
|
|
$score = $_POST['score'];
|
|
|
|
echo $twig->render('resultatsJeux.html', ['points' => $score]);
|
|
|
|
echo $twig->render('resultatsJeux.html', ['points' => $score]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|