From: soufiane Date: Tue, 23 Jan 2024 11:56:10 +0000 (+0100) Subject: wait #6654 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a1fab649bcb407d00de7bbf9e3733ba9910d87fa;p=fluidbook-toolbox-quiz.git wait #6654 @0:20 --- diff --git a/js/quiz.score.js b/js/quiz.score.js index 991ab4a..166c7ea 100644 --- a/js/quiz.score.js +++ b/js/quiz.score.js @@ -99,7 +99,6 @@ QuizScore.prototype = { this_score = 0; for (let answerIndex in question.answers) { const answer = question.answers[answerIndex]; - console.log("answer.drop_area", answer.drop_area, "userAnswers[answerIndex]", userAnswers[answerIndex]) this_score += ((answer.drop_area === userAnswers[answerIndex]) ? answer.score : 0); if(answer.drop_area !== userAnswers[answerIndex]) { @@ -115,13 +114,15 @@ QuizScore.prototype = { min_score = this.getMinScore(question); this_score = 0; for (let k in userAnswers) { + const answer = question.answers[k]; if (parseInt(k) === parseInt(userAnswers[k])) { answersStatus[k] = 'ok' - this_score = userAnswers[k].score + this_score += answer.score } else { answersStatus[k] = 'nok' } } + ok = this_score >= min_score ? 'ok' : 'nok'; log.answer = userAnswers; } else {