From 08ea4a0ac7adc9f3af657711b8d119801a40bf8f Mon Sep 17 00:00:00 2001 From: Van Binh Dang Date: Mon, 6 Nov 2023 09:38:01 -0500 Subject: [PATCH] MDLUM-8760 quiz_markspersection - La note moyenne globale n'est pas correcte --- markspersection_table.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markspersection_table.php b/markspersection_table.php index 2385d35..c7b4827 100644 --- a/markspersection_table.php +++ b/markspersection_table.php @@ -126,7 +126,9 @@ public function calculate_sections_sum($attemptsids) { } $this->attemptsectionsmarks[$colname] += $sumgrades; } - if ($sumgrades !== null) { + // Do not add the same attempt to a section. + if ($sumgrades !== null && + (!isset($this->attemptsids[$colname]) || !in_array($attemptid, $this->attemptsids[$colname]))) { $this->attemptsids[$colname][] = $attemptid; } }