Skip to content

Commit

Permalink
MDL-48655 gradebook: Don't treat a scale with a gradepass of 0 as passed
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmerrill committed Dec 18, 2014
1 parent 981f06f commit fdeda64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/grade/grade_grade.php
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,12 @@ public function is_passed($grade_item = null) {
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;
}

Expand Down

0 comments on commit fdeda64

Please sign in to comment.