MDL-86809 completion: Disable receiveagradegroup when marked as done
Co-authored-by: Yusuf Wibisono <[email protected]>
This commit is contained in:
committed by
David Woloszyn
co-authored by
Yusuf Wibisono
parent
15557a5fc2
commit
d0b6e9bdc1
@@ -475,6 +475,19 @@ trait form_trait {
|
||||
// Don't use hardFreeze or checkbox value gets lost.
|
||||
$mform->freeze($completionviewel);
|
||||
}
|
||||
|
||||
$receivegradegroupel = 'receiveagradegroup' . $suffix;
|
||||
if ($mform->elementExists($receivegradegroupel)) {
|
||||
$groupelements = $mform->getElement($receivegradegroupel)->getElements();
|
||||
foreach ($groupelements as $element) {
|
||||
if ($element->_type == 'select') {
|
||||
$element->updateAttributes(['disabled' => 'disabled']);
|
||||
} else {
|
||||
$element->freeze();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$completionusegradeel = 'completionusegrade' . $suffix;
|
||||
if ($mform->elementExists($completionusegradeel)) {
|
||||
$mform->freeze($completionusegradeel);
|
||||
|
||||
Reference in New Issue
Block a user