Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'MDL-61045' of git://github.com/timhunt/moodle
  • Loading branch information
David Monllao committed Dec 19, 2017
2 parents dcae64d + 06b4ab8 commit d41203c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mod/quiz/mod_form.php
Expand Up @@ -242,6 +242,9 @@ protected function definition() {
'neq', 'wontmatch');
$mform->disabledIf('overallfeedbackduring', 'preferredbehaviour',
'neq', 'wontmatch');
foreach (self::$reviewfields as $field => $notused) {
$mform->disabledIf($field . 'closed', 'timeclose[enabled]');
}

// -------------------------------------------------------------------------------
$mform->addElement('header', 'display', get_string('appearance'));
Expand Down
21 changes: 21 additions & 0 deletions mod/quiz/tests/behat/settings_form_fields_disableif.feature
Expand Up @@ -95,3 +95,24 @@ Feature: Settings form fields disabled if not required
And the "Each attempt builds on the last" "field" should be enabled
And the "id_delay1_enabled" "field" should be enabled
And the "id_delay2_enabled" "field" should be enabled

@javascript
Scenario: Depending on whether there is a close date, some review options are disabled.
When I add a "Quiz" to section "1"
And I expand all fieldsets
And I set the field "Name" to "Test quiz"
Then the "id_attemptclosed" "checkbox" should be disabled
Then the "id_correctnessclosed" "checkbox" should be disabled
Then the "id_marksclosed" "checkbox" should be disabled
Then the "id_specificfeedbackclosed" "checkbox" should be disabled
Then the "id_generalfeedbackclosed" "checkbox" should be disabled
Then the "id_rightanswerclosed" "checkbox" should be disabled
Then the "id_overallfeedbackclosed" "checkbox" should be disabled
And I set the field "id_timeclose_enabled" to "1"
Then the "id_attemptclosed" "checkbox" should be enabled
Then the "id_correctnessclosed" "checkbox" should be enabled
Then the "id_marksclosed" "checkbox" should be enabled
Then the "id_specificfeedbackclosed" "checkbox" should be enabled
Then the "id_generalfeedbackclosed" "checkbox" should be enabled
Then the "id_rightanswerclosed" "checkbox" should be enabled
Then the "id_overallfeedbackclosed" "checkbox" should be enabled

0 comments on commit d41203c

Please sign in to comment.