Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-41446 Completion: Incorrectly marks complete when grade data pres…

…ent with no actual grade
  • Loading branch information...
commit 2d124e8f4ea2440d82a9fd2b80225f1b9246d3bf 1 parent e78a2d0
@sammarshallou sammarshallou authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/completionlib.php
View
5 lib/completionlib.php
@@ -1195,9 +1195,12 @@ public function inform_grade_changed($cm, $item, $grade, $deleted) {
* @return int Completion state e.g. COMPLETION_INCOMPLETE
*/
public static function internal_get_grade_state($item, $grade) {
- if (!$grade) {
+ // If no grade is supplied or the grade doesn't have an actual value, then
+ // this is not complete.
+ if (!$grade || (is_null($grade->finalgrade) && is_null($grade->rawgrade))) {
return COMPLETION_INCOMPLETE;
}
+
// Conditions to show pass/fail:
// a) Grade has pass mark (default is 0.00000 which is boolean true so be careful)
// b) Grade is visible (neither hidden nor hidden-until)
Please sign in to comment.
Something went wrong with that request. Please try again.