mirror of
https://github.com/moodle/moodle.git
synced 2025-08-02 15:49:43 +02:00
Merge branch 'MDL-82090' of https://github.com/paulholden/moodle
This commit is contained in:
commit
aa594cce71
1 changed files with 13 additions and 2 deletions
|
@ -484,9 +484,20 @@ trait form_trait {
|
|||
$mform->freeze($completionpassgradeel);
|
||||
|
||||
// Has the completion pass grade completion criteria been set? If it has, then we shouldn't change
|
||||
// the gradepass field.
|
||||
// any of the modules "gradepass" type fields.
|
||||
if ($mform->exportValue($completionpassgradeel)) {
|
||||
$mform->freeze('gradepass');
|
||||
|
||||
// Some modules define separate "gradepass" fields for each of their grade items.
|
||||
$gradepassfieldels = array_merge(['gradepass'], array_map(
|
||||
fn(string $gradeitem) => "{$gradeitem}gradepass",
|
||||
component_gradeitems::get_itemname_mapping_for_component("mod_{$this->_modname}"),
|
||||
));
|
||||
|
||||
foreach ($gradepassfieldels as $gradepassfieldel) {
|
||||
if ($mform->elementExists($gradepassfieldel)) {
|
||||
$mform->freeze($gradepassfieldel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$completiongradeitemnumberel = 'completiongradeitemnumber' . $suffix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue