From fdea5168bd2a6c3bdcb8c4ae46bf5b1000a44709 Mon Sep 17 00:00:00 2001 From: Doug Martin Date: Wed, 6 Mar 2024 14:58:59 -0500 Subject: [PATCH] fix: Average rubric score calculation [PT-187021319] When a score is removed from the rubric the value is set to 0 and in that case the scored question count should not be increased. --- js/util/scoring.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/util/scoring.ts b/js/util/scoring.ts index 9ce8c5ff..85847855 100644 --- a/js/util/scoring.ts +++ b/js/util/scoring.ts @@ -57,7 +57,7 @@ export const computeAvgScore = (scoringSettings: ScoringSettings, rubric: Rubric const rubricScores = getRubricScores(rubric, feedbacks); const {totalScore, scoredQuestions} = rubricScores.reduce((acc, cur) => { let {totalScore, scoredQuestions} = acc; - if (cur !== null) { + if (cur) { totalScore += cur; scoredQuestions++; }