|
|
|
@ -138,8 +138,8 @@ class ControllerUser
|
|
|
|
|
{
|
|
|
|
|
$_SESSION["Score"] = 0;
|
|
|
|
|
$difficulty = $_POST['difficulty'];
|
|
|
|
|
$_SESSION['chapter'] = $_POST['chapter'];
|
|
|
|
|
|
|
|
|
|
$chapter = $_POST['chapter'];
|
|
|
|
|
$_SESSION['id_chapter'] = $_POST['chapter'];
|
|
|
|
|
|
|
|
|
|
$difficultyIsOk = TRUE;
|
|
|
|
|
$chapterIsOk = TRUE;
|
|
|
|
@ -153,7 +153,7 @@ class ControllerUser
|
|
|
|
|
|
|
|
|
|
if ($difficultyIsOk and $chapterIsOk) {
|
|
|
|
|
$_SESSION["PrevTime"] = new DateTime('now');
|
|
|
|
|
$_SESSION["Questions"] = $this->mdQuestion->getQuestionsByChapterAndDifficulty($_SESSION['chapter'], $difficulty);
|
|
|
|
|
$_SESSION["Questions"] = $this->mdQuestion->getQuestionsByChapterAndDifficulty($chapter, $difficulty);
|
|
|
|
|
$_SESSION["Answers"] = array();
|
|
|
|
|
foreach ($_SESSION["Questions"] as $question) {
|
|
|
|
|
$answers = $this->mdAnswer->getAnswersByIDQuestions($question->getId());
|
|
|
|
@ -229,12 +229,13 @@ class ControllerUser
|
|
|
|
|
$Final[$c]["PlayerAnswer"] = $answer;
|
|
|
|
|
$c = $c + 1;
|
|
|
|
|
}
|
|
|
|
|
$idPlayer = $_SESSION["idPlayerConnected"];
|
|
|
|
|
$idChapter = $_SESSION["chapter"];
|
|
|
|
|
// $idPlayer = $_SESSION["idPlayerConnected"];
|
|
|
|
|
// $idChapter = $_SESSION["chapter"];
|
|
|
|
|
// $numScore = $this->mdPlayer->getJouerByPlayerAndChapter( $idPlayer, $idChapter);
|
|
|
|
|
echo $this->twig->render($this->vues["viewScore"], [
|
|
|
|
|
'score' => $_SESSION["Score"],
|
|
|
|
|
'Final' => $Final,
|
|
|
|
|
'numScore' => $this->mdPlayer->getJouerByPlayerAndChapter( $idPlayer, $idChapter),
|
|
|
|
|
// 'numScore' => $numScore,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|