Merge branch 'MDL-33699' of git://github.com/netspotau/moodle-mod_assign
[moodle.git] / mod / assign / locallib.php
index 0f09d1d..a7466d1 100644 (file)
@@ -2582,7 +2582,11 @@ class assign {
                 // different ways to indicate no grade
                 continue;
             }
                 // different ways to indicate no grade
                 continue;
             }
-            if ($current->grade != $modified->grade) {
+            // Treat 0 and null as different values
+            if ($current->grade !== null) {
+                $current->grade = floatval($current->grade);
+            }
+            if ($current->grade !== $modified->grade) {
                 // grade changed
                 if ($this->grading_disabled($modified->userid)) {
                     continue;
                 // grade changed
                 if ($this->grading_disabled($modified->userid)) {
                     continue;