1 |
efrain |
1 |
@mod @mod_quiz
|
|
|
2 |
Feature: Settings form fields disabled if not required
|
|
|
3 |
In to create quizzes as simply as possible
|
|
|
4 |
As a teacher
|
|
|
5 |
I don't need to to use certain form fields.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname |
|
|
|
10 |
| teacher | Teach |
|
|
|
11 |
| student1 | Student1 |
|
|
|
12 |
| student2 | Student2 |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | course | section | name |
|
|
|
23 |
| quiz | C1 | 1 | Test quiz 1 |
|
|
|
24 |
|
|
|
25 |
@javascript
|
|
|
26 |
Scenario: Depending on the number of attempts, different form fields are disabled.
|
|
|
27 |
When I am on the "Test quiz 1" "quiz activity editing" page logged in as teacher
|
|
|
28 |
And I expand all fieldsets
|
|
|
29 |
And I set the field "Attempts allowed" to "1"
|
|
|
30 |
Then the "Grading method" "field" should be disabled
|
|
|
31 |
And the "Each attempt builds on the last" "field" should be disabled
|
|
|
32 |
And the "id_delay1_enabled" "field" should be disabled
|
|
|
33 |
And the "id_delay2_enabled" "field" should be disabled
|
|
|
34 |
|
|
|
35 |
And I set the field "Attempts allowed" to "2"
|
|
|
36 |
And the "Grading method" "field" should be enabled
|
|
|
37 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
38 |
And the "id_delay1_enabled" "field" should be enabled
|
|
|
39 |
And the "id_delay2_enabled" "field" should be disabled
|
|
|
40 |
|
|
|
41 |
And I set the field "Attempts allowed" to "3"
|
|
|
42 |
And the "Grading method" "field" should be enabled
|
|
|
43 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
44 |
And the "id_delay1_enabled" "field" should be enabled
|
|
|
45 |
And the "id_delay2_enabled" "field" should be enabled
|
|
|
46 |
|
|
|
47 |
And I set the field "Attempts allowed" to "Unlimited"
|
|
|
48 |
And the "Grading method" "field" should be enabled
|
|
|
49 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
50 |
# And the "id_delay1_enabled" "field" should be enabled
|
|
|
51 |
# And the "id_delay2_enabled" "field" should be enabled
|
|
|
52 |
|
|
|
53 |
And I press "Save and display"
|
|
|
54 |
And I navigate to "Overrides" in current page administration
|
|
|
55 |
And I press "Add user override"
|
|
|
56 |
And I set the following fields to these values:
|
|
|
57 |
| Override user | Student1 |
|
|
|
58 |
| Attempts allowed | 3 |
|
|
|
59 |
And I press "Save"
|
|
|
60 |
And I navigate to "Settings" in current page administration
|
|
|
61 |
And I expand all fieldsets
|
|
|
62 |
And I set the field "Attempts allowed" to "1"
|
|
|
63 |
And the "Grading method" "field" should be enabled
|
|
|
64 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
65 |
And the "id_delay1_enabled" "field" should be enabled
|
|
|
66 |
And the "id_delay2_enabled" "field" should be enabled
|
|
|
67 |
|
|
|
68 |
And I press "Save and display"
|
|
|
69 |
And I navigate to "Overrides" in current page administration
|
|
|
70 |
And I click on "Edit" "link" in the "region-main" "region"
|
|
|
71 |
And I set the field "Attempts allowed" to "2"
|
|
|
72 |
And I press "Save"
|
|
|
73 |
And I navigate to "Settings" in current page administration
|
|
|
74 |
And I expand all fieldsets
|
|
|
75 |
And I set the field "Attempts allowed" to "1"
|
|
|
76 |
And the "Grading method" "field" should be enabled
|
|
|
77 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
78 |
And the "id_delay1_enabled" "field" should be enabled
|
|
|
79 |
And the "id_delay2_enabled" "field" should be disabled
|
|
|
80 |
|
|
|
81 |
And I press "Save and display"
|
|
|
82 |
And I navigate to "Overrides" in current page administration
|
|
|
83 |
And I press "Add user override"
|
|
|
84 |
And I set the following fields to these values:
|
|
|
85 |
| Override user | Student2 |
|
|
|
86 |
| Attempts allowed | Unlimited |
|
|
|
87 |
And I press "Save"
|
|
|
88 |
And I navigate to "Settings" in current page administration
|
|
|
89 |
And I expand all fieldsets
|
|
|
90 |
And I set the field "Attempts allowed" to "1"
|
|
|
91 |
And the "Grading method" "field" should be enabled
|
|
|
92 |
And the "Each attempt builds on the last" "field" should be enabled
|
|
|
93 |
And the "id_delay1_enabled" "field" should be enabled
|
|
|
94 |
And the "id_delay2_enabled" "field" should be enabled
|
|
|
95 |
|
|
|
96 |
@javascript
|
|
|
97 |
Scenario: Depending on whether there is a close date, some review options are disabled.
|
|
|
98 |
When I log in as "teacher"
|
|
|
99 |
And I add a quiz activity to course "Course 1" section "1"
|
|
|
100 |
And I expand all fieldsets
|
|
|
101 |
And I set the field "Name" to "Test quiz"
|
|
|
102 |
Then the "id_attemptclosed" "checkbox" should be disabled
|
|
|
103 |
And the "id_correctnessclosed" "checkbox" should be disabled
|
|
|
104 |
And the "id_maxmarksclosed" "checkbox" should be disabled
|
|
|
105 |
And the "id_marksclosed" "checkbox" should be disabled
|
|
|
106 |
And the "id_specificfeedbackclosed" "checkbox" should be disabled
|
|
|
107 |
And the "id_generalfeedbackclosed" "checkbox" should be disabled
|
|
|
108 |
And the "id_rightanswerclosed" "checkbox" should be disabled
|
|
|
109 |
And the "id_overallfeedbackclosed" "checkbox" should be disabled
|
|
|
110 |
And I set the field "id_timeclose_enabled" to "1"
|
|
|
111 |
And the "id_attemptclosed" "checkbox" should be enabled
|
|
|
112 |
And the "id_correctnessclosed" "checkbox" should be enabled
|
|
|
113 |
And the "id_maxmarksclosed" "checkbox" should be enabled
|
|
|
114 |
And the "id_marksclosed" "checkbox" should be enabled
|
|
|
115 |
And I set the field "id_maxmarksclosed" to "0"
|
|
|
116 |
And the "id_marksclosed" "checkbox" should be disabled
|
|
|
117 |
And the "id_specificfeedbackclosed" "checkbox" should be enabled
|
|
|
118 |
And the "id_generalfeedbackclosed" "checkbox" should be enabled
|
|
|
119 |
And the "id_rightanswerclosed" "checkbox" should be enabled
|
|
|
120 |
And the "id_overallfeedbackclosed" "checkbox" should be enabled
|
|
|
121 |
And I set the field "id_maxmarksduring" to "0"
|
|
|
122 |
And the "id_marksduring" "checkbox" should be disabled
|
|
|
123 |
And I should not see "Repaginate now"
|
|
|
124 |
|
|
|
125 |
@javascript
|
|
|
126 |
Scenario: If there are quiz attempts, there is not option to repaginate.
|
|
|
127 |
Given the following "activities" exist:
|
|
|
128 |
| activity | name | intro | course | idnumber |
|
|
|
129 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
|
|
|
130 |
And the following "question categories" exist:
|
|
|
131 |
| contextlevel | reference | name |
|
|
|
132 |
| Course | C1 | Test questions |
|
|
|
133 |
And the following "questions" exist:
|
|
|
134 |
| questioncategory | qtype | name | questiontext |
|
|
|
135 |
| Test questions | truefalse | TF1 | First question |
|
|
|
136 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
137 |
And quiz "Quiz 1" contains the following questions:
|
|
|
138 |
| question | page | maxmark |
|
|
|
139 |
| TF1 | 1 | |
|
|
|
140 |
When I am on the "Quiz 1" "quiz activity editing" page logged in as teacher
|
|
|
141 |
And I expand all fieldsets
|
|
|
142 |
Then I should see "Repaginate now"
|
|
|
143 |
And user "student1" has attempted "Quiz 1" with responses:
|
|
|
144 |
| slot | response |
|
|
|
145 |
| 1 | True |
|
|
|
146 |
And I am on the "Quiz 1" "quiz activity editing" page
|
|
|
147 |
And I expand all fieldsets
|
|
|
148 |
And I should not see "Repaginate now"
|