From 7bc1a7059f5347cf31c2c8423a2c73dd6dd88e77 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Fri, 15 Dec 2023 15:31:08 +0100 Subject: [PATCH] ratio victoire --- .../server/api/controllers/SessionController.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cryptide_project/server/api/controllers/SessionController.js b/cryptide_project/server/api/controllers/SessionController.js index 653389c..f5bab6c 100644 --- a/cryptide_project/server/api/controllers/SessionController.js +++ b/cryptide_project/server/api/controllers/SessionController.js @@ -36,11 +36,17 @@ class SessionController { let nbGamesEF = await db.getNbGamesEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE); nbGamesEF = nbGamesEF.nbGames || 0; let nbWinsEF = await db.getNbWinsEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE); + console.log("nbWinsEF") + console.log(nbWinsEF) nbWinsEF = nbWinsEF.nbWins || 0; + console.log("nbWinsEF") + console.log(nbWinsEF) let ratioEF = 0; if (nbWinsEF.nbWins > 0){ ratioEF = (nbWinsEF.nbWins / nbGamesEF.nbGames) * 100; } + console.log("ratioEF") + console.log(ratioEF) let bestTimeEF = await db.getBestTimeEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE); bestTimeEF = bestTimeEF.bestTime || 0; let avgTimeEF = await db.getAvgTimeEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE);