Merge branch 'MDL-33699' of git://github.com/netspotau/moodle-mod_assign
authorDan Poltawski <dan@moodle.com>
Mon, 18 Jun 2012 05:49:16 +0000 (13:49 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 18 Jun 2012 05:49:16 +0000 (13:49 +0800)
mod/assign/locallib.php

index 0f09d1d..a7466d1 100644 (file)
@@ -2582,7 +2582,11 @@ class assign {
                 // 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;