MDL-31713 core_grade: added updating of grade min and max to update_final_grade()
authorAndrew Davis <andrew@moodle.com>
Sun, 21 Apr 2013 07:30:13 +0000 (15:30 +0800)
committerAndrew Davis <andrew@moodle.com>
Tue, 7 May 2013 04:27:39 +0000 (12:27 +0800)
lib/grade/grade_item.php

index 4610192..8d66765 100644 (file)
@@ -1503,6 +1503,11 @@ class grade_item extends grade_object {
         $oldgrade->feedback       = $grade->feedback;
         $oldgrade->feedbackformat = $grade->feedbackformat;
 
+        // MDL-31713 rawgramemin and max must be up to date so conditional access %'s works properly.
+        $grade->rawgrademin = $this->grademin;
+        $grade->rawgrademax = $this->grademax;
+        $grade->rawscaleid  = $this->scaleid;
+
         // changed grade?
         if ($finalgrade !== false) {
             if ($this->is_overridable_item()) {