MDL-12356 Patched grade_grade->is_passed() method so that it returns null when the gradepass value is null or equal to grademin, or when the finalgrade is null. Merging from MOODLE_19_STABLE

This commit is contained in:
nicolasconnault
2008-03-07 14:09:43 +00:00
parent a1f27717db
commit e64779883b
2 changed files with 13 additions and 0 deletions
+2
View 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
+11
View 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;
}