fix : end of last commit
continuous-integration/drone/push Build is passing Details

pull/35/head
BelsethUwU 2 years ago
parent 08543cbea3
commit e390a93eb5

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

@ -1,19 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<html>
<head> <head>
<meta charset=utf-8> <title>Maths Educ</title>
<title>Math'Educ</title> <meta charset="UTF-8">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> <link rel="stylesheet" href="css/global.css">
<link rel="stylesheet" href="css/global.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</head> </head>
<body id="bodyStyle"> <body id="bodyStyle">
<div class="mt-5 border border-1 border-black p-3 bg-success text-white d-flex flex-column align-items-center">
<p>🏆 Score : 🏆</p>
<p>{{ score }}</p> <p>{{ score }}</p>
<ul> </div>
{{ % for question in questions % }}
<li> <div class="d-flex flex-column align-items-center text-light fs-3">
{% for question in questions %}
<p> <p>
Question : {{ question['content'] }} Question : {{ question['content'] }}
</p> </p>
@ -23,9 +27,9 @@
<p> <p>
Votre réponse : {{ question['playerAnswersContent'] }} Votre réponse : {{ question['playerAnswersContent'] }}
</p> </p>
</li>
{% endfor %} {% endfor %}
</ul> </div>
</body> </body>
</html> </html>
Loading…
Cancel
Save