Merge branch 'MDL-45376-m25' of https://github.com/sammarshallou/moodle into MOODLE_25_STABLE

This commit is contained in:
Dan Poltawski
2014-05-06 11:17:13 +08:00
+4 -2
View File
@@ -209,8 +209,10 @@ abstract class moodleform_mod extends moodleform {
// is changed, maybe someone has completed it now)
$mform->getElement('completionunlocked')->setValue(1);
} else {
// Has the element been unlocked?
if ($mform->exportValue('unlockcompletion')) {
// Has the element been unlocked, either by the button being pressed
// in this request, or the field already being set from a previous one?
if ($mform->exportValue('unlockcompletion') ||
$mform->exportValue('completionunlocked')) {
// Yes, add in warning text and set the hidden variable
$mform->insertElementBefore(
$mform->createElement('static', 'completedunlocked',