fix : probleme page blanche
continuous-integration/drone/push Build is passing Details

pull/37/head
Maxence GUITARD 1 year ago
parent 6ddf62bea5
commit 30e1e91471

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

@ -1,5 +1,10 @@
<?php <?php
namespace gateways;
use usages\Connection;
use \PDO;
class GatewayJouer class GatewayJouer
{ {
private $con; private $con;

@ -3,6 +3,7 @@
namespace models; namespace models;
use gateways\GatewayPlayer; use gateways\GatewayPlayer;
use gateways\GatewayJouer;
use classes\Player; use classes\Player;
class ModelPlayer class ModelPlayer

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<html>
<head> <head>
<meta charset=utf-8> <meta charset=utf-8>

@ -12,11 +12,6 @@
</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 fs-5">
<p>🏆 Score : 🏆</p>
<p> {{ numScore }} </p>
<p>{{ score }}</p>
</div>
<canvas id="confetti"></canvas> <canvas id="confetti"></canvas>
<div class="mb-3 border border-1 border-black bg-success p-2 text-white fs-3"> <div class="mb-3 border border-1 border-black bg-success p-2 text-white fs-3">

Loading…
Cancel
Save