diff --git a/Controller/ResoudreGateway.php b/Controller/ResoudreGateway.php index 2d9ab802..11ced673 100644 --- a/Controller/ResoudreGateway.php +++ b/Controller/ResoudreGateway.php @@ -367,4 +367,12 @@ class ResoudreGateway "classement" => array($playerNumberPerGame, SQLITE3_INTEGER))); } + public function cleanCodeAfterGame(int $idPartie) { + $query = "UPDATE Resoudre + SET code=:code + WHERE partie=:partie"; + $this->con->executeQuery($query, array( + "partie" => array($idPartie, SQLITE3_INTEGER), + "code" => array('', SQLITE3_TEXT))); + } } \ No newline at end of file diff --git a/Model/UserModel.php b/Model/UserModel.php index 7239e266..bab3c204 100644 --- a/Model/UserModel.php +++ b/Model/UserModel.php @@ -205,10 +205,7 @@ class UserModel $points = 0; $result = $this->resoudre_gateway->getAllByPartieAndUtilisateur($mailUtilisateur, $idPartie); foreach ($result as $row){ - if ($row['temps'] == 0){ - $points += 0; - } - else if ($row['ended'] == 0){ + if ($row['temps'] == 0 || $row['ended'] == 0){ $points += 0; } else if ($row['classement'] == 1){ @@ -261,6 +258,7 @@ class UserModel return true; } public function endGame(int $idPartie) { + $this->resoudre_gateway->cleanCodeAfterGame($idPartie); $this->partie_gateway->endGame($idPartie); } diff --git a/View/src/JS/dashboard.js b/View/src/JS/dashboard.js index 7c17b11b..7feb7fa7 100644 --- a/View/src/JS/dashboard.js +++ b/View/src/JS/dashboard.js @@ -33,11 +33,7 @@ interval: 1 }, axisY: { - title: "Point", - titleFontColor: "#6D78AD", - lineColor: "#6D78AD", - gridThickness: 0, - lineThickness: 1, + title: "Point" }, legend: { verticalAlign: "top",