Correction de bug : sauvegarde du code en Multi

ServeurDeTest
Noé GARNIER 2 years ago
parent 91815d33ed
commit 6da53ff4bc

@ -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)));
}
}

@ -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);
}

@ -33,11 +33,7 @@
interval: 1
},
axisY: {
title: "Point",
titleFontColor: "#6D78AD",
lineColor: "#6D78AD",
gridThickness: 0,
lineThickness: 1,
title: "Point"
},
legend: {
verticalAlign: "top",

Loading…
Cancel
Save