Skip to content

Commit d41203c

Browse files
author
David Monllao
committed
Merge branch 'MDL-61045' of git://github.com/timhunt/moodle
2 parents dcae64d + 06b4ab8 commit d41203c

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

mod/quiz/mod_form.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ protected function definition() {
242242
'neq', 'wontmatch');
243243
$mform->disabledIf('overallfeedbackduring', 'preferredbehaviour',
244244
'neq', 'wontmatch');
245+
foreach (self::$reviewfields as $field => $notused) {
246+
$mform->disabledIf($field . 'closed', 'timeclose[enabled]');
247+
}
245248

246249
// -------------------------------------------------------------------------------
247250
$mform->addElement('header', 'display', get_string('appearance'));

mod/quiz/tests/behat/settings_form_fields_disableif.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,24 @@ Feature: Settings form fields disabled if not required
9595
And the "Each attempt builds on the last" "field" should be enabled
9696
And the "id_delay1_enabled" "field" should be enabled
9797
And the "id_delay2_enabled" "field" should be enabled
98+
99+
@javascript
100+
Scenario: Depending on whether there is a close date, some review options are disabled.
101+
When I add a "Quiz" to section "1"
102+
And I expand all fieldsets
103+
And I set the field "Name" to "Test quiz"
104+
Then the "id_attemptclosed" "checkbox" should be disabled
105+
Then the "id_correctnessclosed" "checkbox" should be disabled
106+
Then the "id_marksclosed" "checkbox" should be disabled
107+
Then the "id_specificfeedbackclosed" "checkbox" should be disabled
108+
Then the "id_generalfeedbackclosed" "checkbox" should be disabled
109+
Then the "id_rightanswerclosed" "checkbox" should be disabled
110+
Then the "id_overallfeedbackclosed" "checkbox" should be disabled
111+
And I set the field "id_timeclose_enabled" to "1"
112+
Then the "id_attemptclosed" "checkbox" should be enabled
113+
Then the "id_correctnessclosed" "checkbox" should be enabled
114+
Then the "id_marksclosed" "checkbox" should be enabled
115+
Then the "id_specificfeedbackclosed" "checkbox" should be enabled
116+
Then the "id_generalfeedbackclosed" "checkbox" should be enabled
117+
Then the "id_rightanswerclosed" "checkbox" should be enabled
118+
Then the "id_overallfeedbackclosed" "checkbox" should be enabled

0 commit comments

Comments
 (0)