From c5908481587a48753972856a4b30a308524d7d49 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 15 Nov 2013 14:41:48 +0000 Subject: [PATCH] MDL-42880 quiz settings: remove unnecessary disabledif rules. These rules were causing problems in the case where the form was sumitted with validation errors. In that case, the During the attempt -> The attempt checkbox was becoming unset, and hence the other During the attmept checkboxes became disabled, and the values were not saved. Thanks to Sam Marshall for suggesting this fix. --- mod/quiz/mod_form.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index 69ce444dc36..0b904aed554 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -426,10 +426,12 @@ class mod_quiz_mod_form extends moodleform_mod { } } - $mform->disabledIf('correctness' . $whenname, 'attempt' . $whenname); - $mform->disabledIf('specificfeedback' . $whenname, 'attempt' . $whenname); - $mform->disabledIf('generalfeedback' . $whenname, 'attempt' . $whenname); - $mform->disabledIf('rightanswer' . $whenname, 'attempt' . $whenname); + if ($whenname != 'during') { + $mform->disabledIf('correctness' . $whenname, 'attempt' . $whenname); + $mform->disabledIf('specificfeedback' . $whenname, 'attempt' . $whenname); + $mform->disabledIf('generalfeedback' . $whenname, 'attempt' . $whenname); + $mform->disabledIf('rightanswer' . $whenname, 'attempt' . $whenname); + } } protected function preprocessing_review_settings(&$toform, $whenname, $when) {