From d370898f6b9e70169fe1d0dc7591dc9dc6e85e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Tue, 10 Jan 2023 17:33:01 +0100 Subject: [PATCH] =?UTF-8?q?Corection=20du=20calcul=20du=20temps=20de=20r?= =?UTF-8?q?=C3=A9solution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WEB/Model/UserModel.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WEB/Model/UserModel.php b/WEB/Model/UserModel.php index f13d3f76..e572f807 100644 --- a/WEB/Model/UserModel.php +++ b/WEB/Model/UserModel.php @@ -45,7 +45,6 @@ class UserModel public function calculTpsMaXPartie( int $idPartie) : int { $lesIdEnigmes = $this->partie_gateway->findAllEnigmeIdInPartie($idPartie); - var_dump($lesIdEnigmes); foreach ($lesIdEnigmes as $idEnigme){ $enigme = $this->enigme_gateway->findById($idEnigme)[0]; $tpsMaxPartie += $enigme->getTempsDeResolution(); @@ -109,9 +108,8 @@ class UserModel public function enigmeMultiEnded(string $mailUtilisateur, int $enigmeId){ $idPartie = $_SESSION['idPartie']; $dateDebut = $this->partie_gateway->getDateDebut($idPartie); - $end_time = $dateDebut->modify('+'. $_SESSION['tpsMaxPartie'] .'seconds'); $now = new DateTime(); - $interval = $now->diff($end_time); + $interval = $now->diff($dateDebut); $tempDeResolution = $interval->days * 24 * 60 * 60 + $interval->h * 60 * 60 + $interval->i * 60 + $interval->s; $result = $this->resoudre_gateway->getMaxClassement($enigmeId, $idPartie); if ($result == 0){