Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Arquisoft/wiq_es3a
Browse files Browse the repository at this point in the history
  • Loading branch information
UO285267 committed Apr 27, 2024
2 parents e6e071a + f3bfce6 commit be8267b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions statistics/statisticsservice/statistics-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ app.post('/addStatistic', async (req, res) => {
app.get('/ranking/accuracy', async (req, res) => {
try {
const users = await Statistic.find(); // Obtener todos los usuarios
let roundedAccuracy=0;
const rankedUsers = users.map(user => {
let roundedAccuracy;
if(user.wrongAnswers === 0 & user.rigthAnswers !=0) return { username: user.username, accuracy: 100 }; // Evitar división por cero (no se han jugado partidas
Expand Down

0 comments on commit be8267b

Please sign in to comment.