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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user