From 80f907b4b98c3a46fedd6b0f2957d3a5b14c2693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Tue, 17 Jan 2023 00:07:56 +0100 Subject: [PATCH] Correction --- Model/UserModel.php | 8 ++++---- View/src/JS/dashboard.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Model/UserModel.php b/Model/UserModel.php index 885ad188..fa579a8d 100644 --- a/Model/UserModel.php +++ b/Model/UserModel.php @@ -306,16 +306,16 @@ class UserModel $score[] = 0; } else if ($row['classement'] == 1){ - $score[] = (int)$$this->enigme_gateway->findById($row['enigme'])[0]->getPoints(); + $score[] = $this->enigme_gateway->findById($row['enigme'])[0]->getPoints(); } else if ($row['classement'] == 2){ - $score[] = (int)$$this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.75; + $score[] = $this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.75; } else if ($row['classement'] == 3){ - $score[] = (int)$$this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.5; + $score[] = $this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.5; } else{ - $score[] = (int)$this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.25; + $score[] = $this->enigme_gateway->findById($row['enigme'])[0]->getPoints() * 0.25; } } return $score; diff --git a/View/src/JS/dashboard.js b/View/src/JS/dashboard.js index 772b8137..9fbb5c0d 100644 --- a/View/src/JS/dashboard.js +++ b/View/src/JS/dashboard.js @@ -14,7 +14,7 @@ v1.xValueFormatString=lesInfos[0][i]; v1.dataPoints=[]; for (j = 0; j < lesInfos[1].length; j++) { - v1.dataPoints.push({x:j+1,y:lesInfos[1][j]}); + v1.dataPoints.push({x:j+1,y:lesInfos[1][j][0]}); } data.push(v1); }