Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

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