From 46341ab7101d75e2ac75df53f9edf0ace3d0c69e Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 10 Jul 2006 21:52:12 +0000 Subject: [PATCH] Bug #5732 - Lesson Scores "out of XX" marks report incorrect mark; merged from MOODLE_16_STABLE --- mod/lesson/locallib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index d6798da6ac..f4dbf8fb6b 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1286,9 +1286,9 @@ function lesson_grade($lesson, $ntries, $userid = 0) { $bestscores = array(); // Find the highest possible score per page to get our total foreach ($answers as $answer) { - if(isset($bestscores[$answer->pageid]) and $bestscores[$answer->pageid] < $answer->score) { + if(!isset($bestscores[$answer->pageid])) { $bestscores[$answer->pageid] = $answer->score; - } else { + } else if ($bestscores[$answer->pageid] < $answer->score) { $bestscores[$answer->pageid] = $answer->score; } } -- 2.39.5