Permalink
Browse files

MDL-32076 core_grade: fixed handling of unlimited grades

  • Loading branch information...
1 parent 5e3412d commit cd536c6be5c5d1a5ad8d5b59335112d0f0504d32 @andyjdavis andyjdavis committed Feb 6, 2013
Showing with 8 additions and 5 deletions.
  1. +7 −4 grade/report/grader/ajax_callbacks.php
  2. +1 −1 grade/report/grader/lib.php
@@ -81,10 +81,13 @@
// 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) {
@@ -256,7 +256,7 @@ public function process_data($data) {
} else {
$bounded = $gradeitem->bounded_grade($finalgrade);
if ($bounded > $finalgrade) {
- $errorstr = 'lessthanmin';
+ $errorstr = 'lessthanmin';
} else if ($bounded < $finalgrade) {
$errorstr = 'morethanmax';
}

0 comments on commit cd536c6

Please sign in to comment.