diff --git a/lib/completionlib.php b/lib/completionlib.php index d1d8141dadd..f0482dbac4c 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -1232,7 +1232,7 @@ class completion_info { } else { $possibleresult = $this->internal_get_grade_state($item, $grade); } - + // OK, let's update state based on this $this->update_state($cm, $possibleresult, $grade->userid); } @@ -1270,8 +1270,14 @@ class completion_info { return COMPLETION_COMPLETE_FAIL; } } else { - // Not displaying pass/fail, but we know grade exists b/c we got here - return COMPLETION_COMPLETE; + // Not displaying pass/fail, so just if there is a grade + if (!is_null($grade->finalgrade) || !is_null($grade->rawgrade)) { + // Grade exists, so maybe complete now + return COMPLETION_COMPLETE; + } else { + // Grade does not exist, so maybe incomplete now + return COMPLETION_INCOMPLETE; + } } }