1 |
efrain |
1 |
@mod @mod_quiz
|
|
|
2 |
Feature: Attempt a quiz where some questions require that the previous question has been answered.
|
|
|
3 |
In order to complete a quiz where questions require previous ones to be complete
|
|
|
4 |
As a student
|
|
|
5 |
I need later questions to appear once earlier ones have been answered.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student | Student | One | student@example.com |
|
|
|
11 |
| teacher | Teacher | One | teacher@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student | C1 | student |
|
|
|
18 |
| teacher | C1 | editingteacher |
|
|
|
19 |
And the following "question categories" exist:
|
|
|
20 |
| contextlevel | reference | name |
|
|
|
21 |
| Course | C1 | Test questions |
|
|
|
22 |
|
|
|
23 |
@javascript
|
|
|
24 |
Scenario Outline: A question that requires the previous one is initially blocked
|
|
|
25 |
Given the following "questions" exist:
|
|
|
26 |
| questioncategory | qtype | name | questiontext |
|
|
|
27 |
| Test questions | truefalse | TF1 | First question |
|
|
|
28 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
29 |
And the following "activities" exist:
|
|
|
30 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
31 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
|
|
|
32 |
And quiz "Quiz 1" contains the following questions:
|
|
|
33 |
| question | page | requireprevious |
|
|
|
34 |
| TF1 | 1 | 0 |
|
|
|
35 |
| TF2 | 1 | 1 |
|
|
|
36 |
|
|
|
37 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
38 |
And I press "Attempt quiz"
|
|
|
39 |
|
|
|
40 |
Then I should see "First question"
|
|
|
41 |
And I should see "This question cannot be attempted until the previous question has been completed."
|
|
|
42 |
And I should not see "Second question"
|
|
|
43 |
And I am on the "Quiz 1 > student > Attempt 1" "mod_quiz > Attempt review" page logged in as "teacher"
|
|
|
44 |
And I should see "First question"
|
|
|
45 |
And I should see "This question cannot be attempted until the previous question has been completed."
|
|
|
46 |
And I should not see "Second question"
|
|
|
47 |
And "Question 1" "link" should exist
|
|
|
48 |
And "Question 2" "link" should not exist
|
|
|
49 |
|
|
|
50 |
Examples:
|
|
|
51 |
| quizbehaviour |
|
|
|
52 |
| immediatefeedback |
|
|
|
53 |
| interactive |
|
|
|
54 |
|
|
|
55 |
@javascript
|
|
|
56 |
Scenario Outline: A question is shown as blocked when previewing a quiz
|
|
|
57 |
Given the following "questions" exist:
|
|
|
58 |
| questioncategory | qtype | name | questiontext |
|
|
|
59 |
| Test questions | truefalse | TF1 | First question |
|
|
|
60 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
61 |
And the following "activities" exist:
|
|
|
62 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
63 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
|
|
|
64 |
And quiz "Quiz 1" contains the following questions:
|
|
|
65 |
| question | page | requireprevious |
|
|
|
66 |
| TF1 | 1 | 0 |
|
|
|
67 |
| TF2 | 1 | 1 |
|
|
|
68 |
|
|
|
69 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
|
|
|
70 |
And I press "Preview quiz"
|
|
|
71 |
|
|
|
72 |
Then I should see "First question"
|
|
|
73 |
And I should see "This question cannot be attempted until the previous question has been completed."
|
|
|
74 |
And I should not see "Second question"
|
|
|
75 |
|
|
|
76 |
Examples:
|
|
|
77 |
| quizbehaviour |
|
|
|
78 |
| immediatefeedback |
|
|
|
79 |
| interactive |
|
|
|
80 |
|
|
|
81 |
@javascript
|
|
|
82 |
Scenario Outline: A question requires the previous one becomes available when the first one is answered
|
|
|
83 |
Given the following "questions" exist:
|
|
|
84 |
| questioncategory | qtype | name | questiontext |
|
|
|
85 |
| Test questions | truefalse | TF1 | First question |
|
|
|
86 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
87 |
And the following "activities" exist:
|
|
|
88 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
89 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | <quizbehaviour> |
|
|
|
90 |
And quiz "Quiz 1" contains the following questions:
|
|
|
91 |
| question | page | requireprevious |
|
|
|
92 |
| TF1 | 1 | 0 |
|
|
|
93 |
| TF2 | 1 | 1 |
|
|
|
94 |
|
|
|
95 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
96 |
And I press "Attempt quiz"
|
|
|
97 |
And I click on "True" "radio" in the "First question" "question"
|
|
|
98 |
And I press "Check"
|
|
|
99 |
|
|
|
100 |
Then I should see "First question"
|
|
|
101 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
102 |
And I should see "Second question"
|
|
|
103 |
And "Question 1" "link" should exist
|
|
|
104 |
And "Question 2" "link" should exist
|
|
|
105 |
|
|
|
106 |
Examples:
|
|
|
107 |
| quizbehaviour |
|
|
|
108 |
| immediatefeedback |
|
|
|
109 |
| interactive |
|
|
|
110 |
|
|
|
111 |
@javascript
|
|
|
112 |
Scenario: After quiz submitted, all questions show on the review page
|
|
|
113 |
Given the following "questions" exist:
|
|
|
114 |
| questioncategory | qtype | name | questiontext |
|
|
|
115 |
| Test questions | truefalse | TF1 | First question |
|
|
|
116 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
117 |
And the following "activities" exist:
|
|
|
118 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
119 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
|
|
|
120 |
And quiz "Quiz 1" contains the following questions:
|
|
|
121 |
| question | page | requireprevious |
|
|
|
122 |
| TF1 | 1 | 0 |
|
|
|
123 |
| TF2 | 1 | 1 |
|
|
|
124 |
|
|
|
125 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
126 |
And I press "Attempt quiz"
|
|
|
127 |
And I press "Finish attempt ..."
|
|
|
128 |
And I press "Submit all and finish"
|
|
|
129 |
And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
|
|
|
130 |
|
|
|
131 |
Then the state of "First question" question is shown as "Not answered"
|
|
|
132 |
And the state of "Second question" question is shown as "Not answered"
|
|
|
133 |
|
|
|
134 |
@javascript
|
|
|
135 |
Scenario: A questions cannot be blocked in a deferred feedback quiz (despite what is set in the DB).
|
|
|
136 |
Given the following "questions" exist:
|
|
|
137 |
| questioncategory | qtype | name | questiontext |
|
|
|
138 |
| Test questions | truefalse | TF1 | First question |
|
|
|
139 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
140 |
And the following "activities" exist:
|
|
|
141 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
142 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | deferredfeedback |
|
|
|
143 |
And quiz "Quiz 1" contains the following questions:
|
|
|
144 |
| question | page | requireprevious |
|
|
|
145 |
| TF1 | 1 | 0 |
|
|
|
146 |
| TF2 | 1 | 1 |
|
|
|
147 |
|
|
|
148 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
149 |
And I press "Attempt quiz"
|
|
|
150 |
|
|
|
151 |
Then I should see "First question"
|
|
|
152 |
And I should see "Second question"
|
|
|
153 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
154 |
|
|
|
155 |
@javascript
|
|
|
156 |
Scenario: Questions cannot be blocked in a shuffled section (despite what is set in the DB).
|
|
|
157 |
Given the following "questions" exist:
|
|
|
158 |
| questioncategory | qtype | name | questiontext |
|
|
|
159 |
| Test questions | truefalse | TF1 | First question |
|
|
|
160 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
161 |
And the following "activities" exist:
|
|
|
162 |
| activity | name | intro | course | idnumber | preferredbehaviour | questionsperpage |
|
|
|
163 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback | 2 |
|
|
|
164 |
And quiz "Quiz 1" contains the following questions:
|
|
|
165 |
| question | page | requireprevious |
|
|
|
166 |
| TF1 | 1 | 1 |
|
|
|
167 |
| TF2 | 2 | 1 |
|
|
|
168 |
And quiz "Quiz 1" contains the following sections:
|
|
|
169 |
| heading | firstslot | shuffle |
|
|
|
170 |
| Section 1 | 1 | 1 |
|
|
|
171 |
|
|
|
172 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
173 |
And I press "Attempt quiz"
|
|
|
174 |
|
|
|
175 |
Then I should see "First question"
|
|
|
176 |
And I should see "Second question"
|
|
|
177 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
178 |
|
|
|
179 |
@javascript
|
|
|
180 |
Scenario: Question dependency cannot apply to the first questions in section when the previous section is shuffled
|
|
|
181 |
Given the following "questions" exist:
|
|
|
182 |
| questioncategory | qtype | name | questiontext |
|
|
|
183 |
| Test questions | truefalse | TF1 | First question |
|
|
|
184 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
185 |
And the following "activities" exist:
|
|
|
186 |
| activity | name | intro | course | idnumber | preferredbehaviour | questionsperpage |
|
|
|
187 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback | 2 |
|
|
|
188 |
And quiz "Quiz 1" contains the following questions:
|
|
|
189 |
| question | page | requireprevious |
|
|
|
190 |
| TF1 | 1 | 1 |
|
|
|
191 |
| TF2 | 2 | 1 |
|
|
|
192 |
And quiz "Quiz 1" contains the following sections:
|
|
|
193 |
| heading | firstslot | shuffle |
|
|
|
194 |
| Section 1 | 1 | 1 |
|
|
|
195 |
| Section 2 | 2 | 0 |
|
|
|
196 |
|
|
|
197 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
198 |
And I press "Attempt quiz"
|
|
|
199 |
And I press "Next page"
|
|
|
200 |
|
|
|
201 |
Then I should see "Second question"
|
|
|
202 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
203 |
|
|
|
204 |
@javascript
|
|
|
205 |
Scenario: A questions cannot be blocked in sequential quiz (despite what is set in the DB).
|
|
|
206 |
Given the following "questions" exist:
|
|
|
207 |
| questioncategory | qtype | name | questiontext |
|
|
|
208 |
| Test questions | truefalse | TF1 | First question |
|
|
|
209 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
210 |
And the following "activities" exist:
|
|
|
211 |
| activity | name | intro | course | idnumber | preferredbehaviour | navmethod |
|
|
|
212 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback | sequential |
|
|
|
213 |
And quiz "Quiz 1" contains the following questions:
|
|
|
214 |
| question | page | requireprevious |
|
|
|
215 |
| TF1 | 1 | 1 |
|
|
|
216 |
| TF2 | 1 | 1 |
|
|
|
217 |
|
|
|
218 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
219 |
And I press "Attempt quiz"
|
|
|
220 |
|
|
|
221 |
Then I should see "First question"
|
|
|
222 |
And I should see "Second question"
|
|
|
223 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
224 |
|
|
|
225 |
@javascript
|
|
|
226 |
Scenario: A questions not blocked if the previous one cannot finish, e.g. essay (despite what is set in the DB).
|
|
|
227 |
Given the following "questions" exist:
|
|
|
228 |
| questioncategory | qtype | name | questiontext |
|
|
|
229 |
| Test questions | essay | Story | First question |
|
|
|
230 |
| Test questions | truefalse | TF2 | Second question |
|
|
|
231 |
And the following "activities" exist:
|
|
|
232 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
233 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
|
|
|
234 |
And quiz "Quiz 1" contains the following questions:
|
|
|
235 |
| question | page | requireprevious |
|
|
|
236 |
| Story | 1 | 0 |
|
|
|
237 |
| TF2 | 1 | 1 |
|
|
|
238 |
|
|
|
239 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
240 |
And I press "Attempt quiz"
|
|
|
241 |
|
|
|
242 |
Then I should see "First question"
|
|
|
243 |
And I should see "Second question"
|
|
|
244 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|
|
|
245 |
|
|
|
246 |
@javascript
|
|
|
247 |
Scenario: A questions not blocked if the previous one cannot finish, e.g. description (despite what is set in the DB).
|
|
|
248 |
Given the following "questions" exist:
|
|
|
249 |
| questioncategory | qtype | name | questiontext |
|
|
|
250 |
| Test questions | description | Info | Read me |
|
|
|
251 |
| Test questions | truefalse | TF1 | First question |
|
|
|
252 |
And the following "activities" exist:
|
|
|
253 |
| activity | name | intro | course | idnumber | preferredbehaviour |
|
|
|
254 |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | immediatefeedback |
|
|
|
255 |
And quiz "Quiz 1" contains the following questions:
|
|
|
256 |
| question | page | requireprevious |
|
|
|
257 |
| Info | 1 | 0 |
|
|
|
258 |
| TF1 | 1 | 1 |
|
|
|
259 |
|
|
|
260 |
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
|
|
|
261 |
And I press "Attempt quiz"
|
|
|
262 |
|
|
|
263 |
Then I should see "Read me"
|
|
|
264 |
And I should see "First question"
|
|
|
265 |
And I should not see "This question cannot be attempted until the previous question has been completed."
|