]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5732 - Lesson Scores "out of XX" marks report incorrect mark; merged...
authorskodak <skodak>
Mon, 10 Jul 2006 21:52:12 +0000 (21:52 +0000)
committerskodak <skodak>
Mon, 10 Jul 2006 21:52:12 +0000 (21:52 +0000)
mod/lesson/locallib.php

index d6798da6acc548b6589cce38cb8310da1daf0cae..f4dbf8fb6b202d7fbbbb59c5fa7136069027a61f 100644 (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;
                 }
             }