mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-52206 core: Add completion criteria to course_modules
This commit is contained in:
parent
663137748e
commit
90acd8d381
19 changed files with 113 additions and 17 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue