]> git.mjollnir.org Git - moodle.git/commitdiff
mod/assignment if we are not using a numeric scale and a custom scale
authormartinlanghoff <martinlanghoff>
Fri, 4 Aug 2006 05:51:31 +0000 (05:51 +0000)
committermartinlanghoff <martinlanghoff>
Fri, 4 Aug 2006 05:51:31 +0000 (05:51 +0000)
return that as the max grade

Author: Jun Yamog <jun@catalyst.net.nz>

mod/assignment/lib.php

index 227467c6411b71ea4feb59de7409b96874e99d5f..e39c62aeb4a5cd6506e711f69d249b131d1d85b8 100644 (file)
@@ -1816,6 +1816,7 @@ function assignment_grades($assignmentid) {
     } else { // Scale
         if ($grades) {
             $scaleid = - ($assignment->grade);
+            $maxgrade = "";
             if ($scale = get_record('scale', 'id', $scaleid)) {
                 $scalegrades = make_menu_from_list($scale->scale);
                 foreach ($grades as $userid => $grade) {
@@ -1825,10 +1826,11 @@ function assignment_grades($assignmentid) {
                         $grades[$userid] = $scalegrades[$grade];
                     }
                 }
+                $maxgrade = $scale->name;
             }
         }
         $return->grades = $grades;
-        $return->maxgrade = "";
+        $return->maxgrade = $maxgrade;
     }
 
     return $return;