MDL-52206 core: Add completion criteria to course_modules
This commit is contained in:
+10
-1
@@ -711,7 +711,16 @@ class completion_info {
|
||||
// Check grade
|
||||
if (!is_null($cminfo->completiongradeitemnumber)) {
|
||||
$newstate = $this->get_grade_completion($cminfo, $userid);
|
||||
if ($newstate == COMPLETION_INCOMPLETE) {
|
||||
if ($cm->completionpassgrade) {
|
||||
// If we are asking to use pass grade completion but haven't set it,
|
||||
// then default to COMPLETION_COMPLETE_PASS.
|
||||
if ($newstate == COMPLETION_COMPLETE) {
|
||||
return COMPLETION_COMPLETE_PASS;
|
||||
} else if ($newstate != COMPLETION_COMPLETE_PASS) {
|
||||
// Mark as incomplete if there is no grade provided or the grade has failed.
|
||||
$newstate = COMPLETION_INCOMPLETE;
|
||||
}
|
||||
} else if ($newstate == COMPLETION_INCOMPLETE) {
|
||||
return COMPLETION_INCOMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user