From fdeda649e2f6b6adbe008e4342789d533f0b3770 Mon Sep 17 00:00:00 2001 From: Eric Merrill Date: Thu, 18 Dec 2014 16:17:52 -0500 Subject: [PATCH] MDL-48655 gradebook: Don't treat a scale with a gradepass of 0 as passed --- lib/grade/grade_grade.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/grade/grade_grade.php b/lib/grade/grade_grade.php index 63b99141e08..068acd352c2 100644 --- a/lib/grade/grade_grade.php +++ b/lib/grade/grade_grade.php @@ -913,8 +913,12 @@ class grade_grade extends grade_object { 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 if gradepass == grademin, gradepass is null, or grade item is a scale and gradepass is 0. + if (is_null($this->grade_item->gradepass)) { + return null; + } else if ($this->grade_item->gradepass == $this->grade_item->grademin) { + return null; + } else if ($this->grade_item->gradetype == GRADE_TYPE_SCALE && !grade_floats_different($this->grade_item->gradepass, 0.0)) { return null; }