MDL-33699: Allow grades of 0 in assignment quickgrading
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Fri, 15 Jun 2012 06:42:19 +0000 (14:42 +0800)
committerDamyon Wiese <damyon.wiese@netspot.com.au>
Fri, 15 Jun 2012 07:13:26 +0000 (15:13 +0800)
mod/assign/locallib.php

index 4c4d157..b8d600a 100644 (file)
@@ -2593,7 +2593,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;