Bug #5732 - Lesson Scores "out of XX" marks report incorrect mark; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-07-10 21:52:12 +00:00
parent 411df816d6
commit 46341ab710
+2 -2
View File
@@ -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;
}
}