MDL-27459 Completion: When ratings off, disallow grade completion
For activities that use ratings, there is no grade unless ratings are enabled. The completion system still lets you select 'complete when user gets a grade', which leads to later errors. This change simply disables the 'completion on grade' field if ratings are enabled for the activity, but not turned on in the form.
This commit is contained in:
@@ -496,6 +496,11 @@ abstract class moodleform_mod extends moodleform {
|
||||
$mform->disabledIf('completionusegrade', 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC);
|
||||
$mform->addHelpButton('completionusegrade', 'completionusegrade', 'completion');
|
||||
$gotcompletionoptions = true;
|
||||
|
||||
// If using the rating system, there is no grade unless ratings are enabled.
|
||||
if ($this->_features->rating) {
|
||||
$mform->disabledIf('completionusegrade', 'assessed', 'eq', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Automatic completion according to module-specific rules
|
||||
|
||||
Reference in New Issue
Block a user