]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12356 Patched grade_grade->is_passed() method so that it returns null when the...
authornicolasconnault <nicolasconnault>
Fri, 7 Mar 2008 14:09:43 +0000 (14:09 +0000)
committernicolasconnault <nicolasconnault>
Fri, 7 Mar 2008 14:09:43 +0000 (14:09 +0000)
grade/report/grader/lib.php
lib/grade/grade_grade.php

index de5d91b59dc7586f59c920f848641fd913394859..557462c27fabb44da918d13b038708bc68fcb568 100644 (file)
@@ -762,6 +762,8 @@ class grade_report_grader extends grade_report {
                 $gradepass = ' gradefail '; 
                 if ($grade->is_passed($item)) {
                     $gradepass = ' gradepass ';
+                } elseif (is_null($grade->is_passed($item))) {
+                    $gradepass = '';
                 }
 
                 // if in editting mode, we need to print either a text box
index 45813d48eb4679cd6a6449c5573c156cddaba854..7c72ef4bcc15079c145e85ad5d92660bebdab79d 100644 (file)
@@ -701,6 +701,17 @@ class grade_grade extends grade_object {
             $this->grade_item = $grade_item;
             $this->itemid = $grade_item->id;
         }
+
+        // Return null if finalgrade is null
+        if (is_null($this->finalgrade)) {
+            return null;
+        }
+
+        // Return null if gradepass == grademin or gradepass is null
+        if (is_null($this->grade_item->gradepass) || $this->grade_item->gradepass == $this->grade_item->grademin) {
+            return null;
+        }
+
         return $this->finalgrade >= $this->grade_item->gradepass;
     }