Merge branch 'MDL-32076_unlimited2_23' of git://github.com/andyjdavis/moodle into...
authorDan Poltawski <dan@moodle.com>
Tue, 12 Feb 2013 06:42:43 +0000 (14:42 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 12 Feb 2013 06:42:43 +0000 (14:42 +0800)
grade/report/grader/ajax_callbacks.php
grade/report/grader/lib.php

index 034ef18..6c12063 100644 (file)
@@ -81,10 +81,13 @@ switch ($action) {
                 // Warn if the grade is out of bounds.
                 if (is_null($finalgrade)) {
                     // ok
-                } else if ($finalgrade < $grade_item->grademin) {
-                    $errorstr = 'lessthanmin';
-                } else if ($finalgrade > $grade_item->grademax) {
-                    $errorstr = 'morethanmax';
+                } else {
+                    $bounded = $grade_item->bounded_grade($finalgrade);
+                    if ($bounded > $finalgrade) {
+                        $errorstr = 'lessthanmin';
+                    } else if ($bounded < $finalgrade) {
+                        $errorstr = 'morethanmax';
+                    }
                 }
 
                 if ($errorstr) {
index 9f0eabb..2c653a8 100644 (file)
@@ -256,7 +256,7 @@ class grade_report_grader extends grade_report {
                         } else {
                             $bounded = $gradeitem->bounded_grade($finalgrade);
                             if ($bounded > $finalgrade) {
-                            $errorstr = 'lessthanmin';
+                                $errorstr = 'lessthanmin';
                             } else if ($bounded < $finalgrade) {
                                 $errorstr = 'morethanmax';
                             }