From 5a49aee6fb06b80108b6ed464da6d27236b3c546 Mon Sep 17 00:00:00 2001 From: PierreC Date: Thu, 20 Feb 2025 16:34:22 +0100 Subject: [PATCH] Fix key calculation (#610) --- questionnaire.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/questionnaire.class.php b/questionnaire.class.php index 9c735364..f53d9c3c 100644 --- a/questionnaire.class.php +++ b/questionnaire.class.php @@ -3924,7 +3924,7 @@ public function response_analysis($rid, $resps, $compare, $isgroupmember, $allre // Just in case a question pertaining to a section has been deleted or made not required // after being included in scorecalculation. if (isset($qscore[$qid])) { - $key = ($key == 0) ? 1 : $key; + $key = empty($key) ? 1 : $key; $score[$section] += round($qscore[$qid] * $key); $maxscore[$section] += round($qmax[$qid] * $key); if ($compare || $allresponses) {