|
|
|
@ -109,6 +109,7 @@ class ControllerUser
|
|
|
|
|
foreach ($_SESSION["Questions"] as &$question) {
|
|
|
|
|
$answers = $this->mdAnswer->getAnswersByIDQuestions($question['id']);
|
|
|
|
|
$question['answers'] = $answers;
|
|
|
|
|
var_dump("i");
|
|
|
|
|
}
|
|
|
|
|
echo $this->twig->render($this->vues["singleplayer"], [
|
|
|
|
|
'questions' => $_SESSION["Questions"],
|
|
|
|
@ -141,29 +142,28 @@ class ControllerUser
|
|
|
|
|
$_SESSION["Score"] = $_SESSION["Score"] + 80 + 40 * ((30 - $time->s) / 100 * 10 / 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($numQuestion <= 2) {
|
|
|
|
|
if ($numQuestion <= 1) {
|
|
|
|
|
$_SESSION["PrevTime"] = $_SESSION["CurrTime"];
|
|
|
|
|
echo $this->twig->render($this->vues["singleplayer"], [
|
|
|
|
|
'questions' => $_SESSION["Questions"],
|
|
|
|
|
'numQuestion' => $numQuestion+1,
|
|
|
|
|
'numQuestion' => $numQuestion + 1,
|
|
|
|
|
]);
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($_SESSION["Questions"] as &$question) {
|
|
|
|
|
$answer = $this->mdAnswer->getAnswerByID($question['idanswergood']);
|
|
|
|
|
$question['goodAnswersContent'] = $answer['content'];
|
|
|
|
|
}
|
|
|
|
|
var_dump($_SESSION["Questions"]);
|
|
|
|
|
// echo $this->twig->render($this->vues["viewScore"], [
|
|
|
|
|
// 'score' => $_SESSION["Score"],
|
|
|
|
|
// 'questions' => $_SESSION["Questions"],
|
|
|
|
|
// ]);
|
|
|
|
|
echo $this->twig->render($this->vues["viewScore"], [
|
|
|
|
|
'score' => $_SESSION["Score"],
|
|
|
|
|
'questions' => $_SESSION["Questions"],
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function passer()
|
|
|
|
|
{
|
|
|
|
|
$numQuestion = $_POST["numQuestion"];
|
|
|
|
|
if ($numQuestion <= 9) {
|
|
|
|
|
if ($numQuestion <= 2) {
|
|
|
|
|
$_SESSION["PrevTime"] = $_SESSION["CurrTime"];
|
|
|
|
|
echo $this->twig->render($this->vues["singleplayer"], [
|
|
|
|
|
'questions' => $_SESSION["Questions"],
|
|
|
|
@ -174,7 +174,7 @@ class ControllerUser
|
|
|
|
|
$answer = $this->mdAnswer->getAnswerByID($question['idAnswerGood']);
|
|
|
|
|
$question['GoodAnswersContent'] = $answer['content'];
|
|
|
|
|
}
|
|
|
|
|
echo $this->twig->render($this->vues["ViewScore"], [
|
|
|
|
|
echo $this->twig->render($this->vues["viewScore"], [
|
|
|
|
|
'score' => $_SESSION["Score"],
|
|
|
|
|
'questions' => $_SESSION["Questions"],
|
|
|
|
|
]);
|
|
|
|
|