Permalink
Browse files

Merge branch 'MDL-26768_0_grade' of git://github.com/andyjdavis/moodle

  • Loading branch information...
2 parents 949fe71 + 76027a9 commit e5be555c27196f3c89325c3215ad40d09d2dbef9 @skodak skodak committed Mar 21, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/lesson/lib.php
View
@@ -487,7 +487,13 @@ function lesson_grade_item_update($lesson, $grades=NULL) {
if (!is_array($grade)) {
$grades[$key] = $grade = (array) $grade;
}
- $grades[$key]['rawgrade'] = ($grade['rawgrade'] * $lesson->grade / 100);
+ //check raw grade isnt null otherwise we erroneously insert a grade of 0
+ if ($grade['rawgrade'] !== null) {
+ $grades[$key]['rawgrade'] = ($grade['rawgrade'] * $lesson->grade / 100);
+ } else {
+ //setting rawgrade to null just in case user is deleting a grade
+ $grades[$key]['rawgrade'] = null;
+ }
}
}

0 comments on commit e5be555

Please sign in to comment.