MDL-52206 core: Add completion criteria to course_modules

This commit is contained in:
Peter 2019-12-04 10:14:31 +08:00 committed by Peter Dias
parent 663137748e
commit 90acd8d381
19 changed files with 113 additions and 17 deletions

View file

@ -372,6 +372,12 @@ abstract class moodleform_mod extends moodleform {
}
if ($mform->elementExists('completionpassgrade')) {
$mform->freeze('completionpassgrade');
// Has the completion pass grade completion criteria been set?
// If it has then we shouldn't change the gradepass field.
if ($mform->exportValue('completionpassgrade')) {
$mform->freeze('gradepass');
}
}
if ($mform->elementExists('completiongradeitemnumber')) {
$mform->freeze('completiongradeitemnumber');