Skip to content

Commit

Permalink
Cyberleague: [premieroctet#127] check if a score is finished before c…
Browse files Browse the repository at this point in the history
…omputing its rates
  • Loading branch information
Bastien-Wappizy committed Sep 16, 2024
1 parent b3d1a9a commit eec6e13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/web/server/plugins/cyberleague/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ const postPutData = async ({model, id, params, user}) => {
if (model == 'answer') {
const answer = await Answer.findById(id)
const score = await Score.findById(answer.score)

//if (score.is_drafted) { TODO !!!!
if (score.is_drafted) {
const computedScores = await computeScores(score.answers)

await Score.findByIdAndUpdate(score._id, {$set: {...computedScores}})
//}
}
}
return {model, id, params, user}
}
Expand Down

0 comments on commit eec6e13

Please sign in to comment.