Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Edit quiz page - section headings
3
  In order to build a quiz laid out in sections the way I want
4
  As a teacher
5
  I need to be able to add, edit and remove section headings as well as shuffle
6
  questions within a section.
7
 
8
  Background:
9
    Given the following "users" exist:
10
      | username | firstname | lastname | email                |
11
      | teacher1 | T1        | Teacher1 | teacher1@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
      | teacher1 | C1     | editingteacher |
18
    And the following "question categories" exist:
19
      | contextlevel | reference | name           |
20
      | Course       | C1        | Test questions |
21
    And I log in as "teacher1"
22
 
23
  @javascript
24
  Scenario: We have a quiz with one default section
25
    Given the following "activities" exist:
26
      | activity   | name   | intro              | course | idnumber |
27
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
28
    And the following "questions" exist:
29
      | questioncategory | qtype       | name | questiontext    |
30
      | Test questions   | truefalse   | TF1  | This is question 01 |
31
      | Test questions   | truefalse   | TF2  | This is question 02 |
32
      | Test questions   | truefalse   | TF3  | This is question 03 |
33
    And quiz "Quiz 1" contains the following questions:
34
      | question | page |
35
      | TF1      | 1    |
36
      | TF2      | 2    |
37
      | TF3      | 3    |
38
    When I am on the "Quiz 1" "mod_quiz > Edit" page
39
    Then I should see "Shuffle"
40
 
41
  @javascript
42
  Scenario: Modify the default section headings
43
    Given the following "activities" exist:
44
      | activity   | name   | intro              | course | idnumber |
45
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
46
    When I am on the "Quiz 1" "mod_quiz > Edit" page
47
    And I change quiz section heading "" to "This is section one"
48
    Then I should see "This is section one"
49
 
50
  @javascript
51
  Scenario: Modify section headings
52
    Given the following "activities" exist:
53
      | activity   | name   | intro              | course | idnumber |
54
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
55
    And the following "questions" exist:
56
      | questioncategory | qtype       | name | questiontext    |
57
      | Test questions   | truefalse   | TF1  | This is question 01 |
58
      | Test questions   | truefalse   | TF2  | This is question 02 |
59
      | Test questions   | truefalse   | TF3  | This is question 03 |
60
      | Test questions   | truefalse   | TF4  | This is question 04 |
61
      | Test questions   | truefalse   | TF5  | This is question 05 |
62
    And quiz "Quiz 1" contains the following questions:
63
      | question | page |
64
      | TF1      | 1    |
65
      | TF2      | 2    |
66
      | TF3      | 3    |
67
      | TF4      | 3    |
68
    And quiz "Quiz 1" contains the following sections:
69
      | heading   | firstslot | shuffle |
70
      |           | 1         | 0       |
71
      | Heading 2 | 2         | 0       |
72
      | Heading 3 | 3         | 1       |
73
    When I am on the "Quiz 1" "mod_quiz > Edit" page
74
    And I change quiz section heading "" to "This is section one"
75
    And I change quiz section heading "Heading 2" to "This is section two"
76
    Then I should see "This is section one"
77
    And I should see "This is section two"
78
 
79
  @javascript
80
  Scenario: Set section headings to blanks
81
    Given the following "activities" exist:
82
      | activity   | name   | intro              | course | idnumber |
83
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
84
    And the following "questions" exist:
85
      | questioncategory | qtype       | name | questiontext    |
86
      | Test questions   | truefalse   | TF1  | This is question 01 |
87
      | Test questions   | truefalse   | TF2  | This is question 02 |
88
      | Test questions   | truefalse   | TF3  | This is question 03 |
89
      | Test questions   | truefalse   | TF4  | This is question 04 |
90
      | Test questions   | truefalse   | TF5  | This is question 05 |
91
    And quiz "Quiz 1" contains the following questions:
92
      | question | page |
93
      | TF1      | 1    |
94
      | TF2      | 2    |
95
      | TF3      | 3    |
96
      | TF4      | 3    |
97
    And quiz "Quiz 1" contains the following sections:
98
      | heading   | firstslot | shuffle |
99
      | Heading 1 | 1         | 0       |
100
      | Heading 2 | 2         | 0       |
101
      | Heading 3 | 3         | 1       |
102
    And I am on the "Quiz 1" "mod_quiz > Edit" page
103
    When I change quiz section heading "Heading 1" to ""
104
    Then I should not see "Heading 1"
105
    And I should see "Heading 2"
106
    And I should see "Heading 3"
107
 
108
    And I change quiz section heading "Heading 2" to ""
109
    And I should not see "Heading 1"
110
    And I should not see "Heading 2"
111
    And I should see "Heading 3"
112
 
113
    And I change quiz section heading "Heading 3" to ""
114
    And I should not see "Heading 1"
115
    And I should not see "Heading 2"
116
    And I should not see "Heading 3"
117
 
118
  @javascript
119
  Scenario: Remove a section
120
    Given the following "activities" exist:
121
      | activity   | name   | intro              | course | idnumber |
122
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
123
    And the following "questions" exist:
124
      | questioncategory | qtype       | name | questiontext    |
125
      | Test questions   | truefalse   | TF1  | This is question 01 |
126
      | Test questions   | truefalse   | TF2  | This is question 02 |
127
      | Test questions   | truefalse   | TF3  | This is question 03 |
128
    And quiz "Quiz 1" contains the following questions:
129
      | question | page |
130
      | TF1      | 1    |
131
      | TF2      | 2    |
132
      | TF3      | 3    |
133
    And quiz "Quiz 1" contains the following sections:
134
      | heading   | firstslot | shuffle |
135
      | Heading 1 | 1         | 0       |
136
      | Heading 2 | 2         | 0       |
137
      | Heading 3 | 3         | 1       |
138
    When I am on the "Quiz 1" "mod_quiz > Edit" page
139
    And I follow "Remove heading 'Heading 2'"
140
    And I should see "Are you sure you want to remove the 'Heading 2' section heading?"
141
    And I click on "Yes" "button" in the "Confirm" "dialogue"
142
    And I wait until the page is ready
143
    And I wait until "Heading 2" "text" does not exist
144
    Then I should see "Heading 1"
145
    And I should not see "Heading 2"
146
    And I should see "Heading 3"
147
 
148
  @javascript
149
  Scenario: The edit-icon tool-tips are updated when a section is edited
150
    Given the following "activities" exist:
151
      | activity   | name   | intro              | course | idnumber |
152
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
153
    And the following "questions" exist:
154
      | questioncategory | qtype       | name | questiontext    |
155
      | Test questions   | truefalse   | TF1  | This is question 01 |
156
      | Test questions   | truefalse   | TF2  | This is question 02 |
157
    And quiz "Quiz 1" contains the following questions:
158
      | question | page |
159
      | TF1      | 1    |
160
      | TF2      | 2    |
161
    And quiz "Quiz 1" contains the following sections:
162
      | heading   | firstslot | shuffle |
163
      | Heading 1 | 1         | 0       |
164
      | Heading 2 | 2         | 0       |
165
    When I am on the "Quiz 1" "mod_quiz > Edit" page
166
    And I change quiz section heading "Heading 2" to "Edited heading"
167
    Then I should see "Edited heading"
168
    And "Edit heading 'Edited heading'" "link" should be visible
169
    And "Remove heading 'Edited heading'" "link" should be visible
170
 
171
  @javascript
172
  Scenario: Moving a question up from section 3 to the first section.
173
    Given the following "activities" exist:
174
      | activity   | name   | intro              | course | idnumber |
175
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
176
    And the following "questions" exist:
177
      | questioncategory | qtype       | name | questiontext    |
178
      | Test questions   | truefalse   | TF1  | This is question 01 |
179
      | Test questions   | truefalse   | TF2  | This is question 02 |
180
      | Test questions   | truefalse   | TF3  | This is question 03 |
181
      | Test questions   | truefalse   | TF4  | This is question 04 |
182
      | Test questions   | truefalse   | TF5  | This is question 05 |
183
      | Test questions   | truefalse   | TF6  | This is question 06 |
184
    And quiz "Quiz 1" contains the following questions:
185
      | question | page |
186
      | TF1      | 1    |
187
      | TF2      | 2    |
188
      | TF3      | 3    |
189
      | TF4      | 4    |
190
      | TF5      | 5    |
191
      | TF6      | 6    |
192
    And quiz "Quiz 1" contains the following sections:
193
      | heading   | firstslot | shuffle |
194
      | Heading 1 | 1         | 0       |
195
      | Heading 2 | 3         | 0       |
196
      | Heading 3 | 5         | 1       |
197
    When I am on the "Quiz 1" "mod_quiz > Edit" page
198
    And I move "TF5" to "After Question 2" in the quiz by clicking the move icon
199
    Then I should see "TF5" on quiz page "2"
200
 
201
  @javascript
202
  Scenario: Moving a question down from the first section to the second section.
203
    Given the following "activities" exist:
204
      | activity   | name   | intro              | course | idnumber |
205
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
206
    And the following "questions" exist:
207
      | questioncategory | qtype       | name | questiontext    |
208
      | Test questions   | truefalse   | TF1  | This is question 01 |
209
      | Test questions   | truefalse   | TF2  | This is question 02 |
210
      | Test questions   | truefalse   | TF3  | This is question 03 |
211
      | Test questions   | truefalse   | TF4  | This is question 04 |
212
      | Test questions   | truefalse   | TF5  | This is question 05 |
213
      | Test questions   | truefalse   | TF6  | This is question 06 |
214
    And quiz "Quiz 1" contains the following questions:
215
      | question | page |
216
      | TF1      | 1    |
217
      | TF2      | 2    |
218
      | TF3      | 3    |
219
      | TF4      | 4    |
220
      | TF5      | 5    |
221
      | TF6      | 6    |
222
    And quiz "Quiz 1" contains the following sections:
223
      | heading   | firstslot | shuffle |
224
      | Heading 1 | 1         | 0       |
225
      | Heading 2 | 3         | 0       |
226
      | Heading 3 | 5         | 1       |
227
    When I am on the "Quiz 1" "mod_quiz > Edit" page
228
    And I move "TF1" to "After Question 3" in the quiz by clicking the move icon
229
    Then I should see "TF1" on quiz page "2"
230
 
231
  @javascript
232
  Scenario: I should not see a delete icon for the first section in the quiz.
233
    Given the following "activities" exist:
234
      | activity   | name   | intro              | course | idnumber |
235
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
236
    And the following "questions" exist:
237
      | questioncategory | qtype       | name | questiontext    |
238
      | Test questions   | truefalse   | TF1  | This is question 01 |
239
      | Test questions   | truefalse   | TF2  | This is question 02 |
240
      | Test questions   | truefalse   | TF3  | This is question 03 |
241
    And quiz "Quiz 1" contains the following questions:
242
      | question | page |
243
      | TF1      | 1    |
244
      | TF2      | 2    |
245
      | TF3      | 3    |
246
    And quiz "Quiz 1" contains the following sections:
247
      | heading   | firstslot | shuffle |
248
      | Heading 1 | 1         | 0       |
249
      | Heading 2 | 2         | 0       |
250
      | Heading 3 | 3         | 1       |
251
    When I am on the "Quiz 1" "mod_quiz > Edit" page
252
    Then "Remove heading 'Heading 1'" "link" should not exist
253
    And "Remove heading 'Heading 2'" "link" should exist
254
    And "Remove heading 'Heading 3'" "link" should exist
255
 
256
  @javascript
257
  Scenario: Turn shuffling on for a section
258
    Given the following "activities" exist:
259
      | activity   | name   | intro              | course | idnumber |
260
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
261
    And the following "questions" exist:
262
      | questioncategory | qtype       | name | questiontext    |
263
      | Test questions   | truefalse   | TF1  | This is question 01 |
264
      | Test questions   | truefalse   | TF2  | This is question 02 |
265
      | Test questions   | truefalse   | TF3  | This is question 03 |
266
    And quiz "Quiz 1" contains the following questions:
267
      | question | page |
268
      | TF1      | 1    |
269
      | TF2      | 2    |
270
      | TF3      | 3    |
271
    And quiz "Quiz 1" contains the following sections:
272
      | heading   | firstslot | shuffle |
273
      | Heading 1 | 1         | 0       |
274
      | Heading 2 | 2         | 0       |
275
      | Heading 3 | 3         | 0       |
276
    When I am on the "Quiz 1" "mod_quiz > Edit" page
277
    And I click on shuffle for section "Heading 1" on the quiz edit page
278
    And I click on shuffle for section "Heading 2" on the quiz edit page
279
    Then shuffle for section "Heading 1" should be "On" on the quiz edit page
280
    And shuffle for section "Heading 2" should be "On" on the quiz edit page
281
 
282
  @javascript
283
  Scenario: Turn shuffling off for a section
284
    Given the following "activities" exist:
285
      | activity   | name   | intro              | course | idnumber |
286
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
287
    And the following "questions" exist:
288
      | questioncategory | qtype       | name | questiontext    |
289
      | Test questions   | truefalse   | TF1  | This is question 01 |
290
      | Test questions   | truefalse   | TF2  | This is question 02 |
291
      | Test questions   | truefalse   | TF3  | This is question 03 |
292
    And quiz "Quiz 1" contains the following questions:
293
      | question | page |
294
      | TF1      | 1    |
295
      | TF2      | 2    |
296
      | TF3      | 3    |
297
    And quiz "Quiz 1" contains the following sections:
298
      | heading   | firstslot | shuffle |
299
      | Heading 1 | 1         | 1       |
300
      | Heading 2 | 2         | 1       |
301
      | Heading 3 | 3         | 1       |
302
    When I am on the "Quiz 1" "mod_quiz > Edit" page
303
    And I click on shuffle for section "Heading 1" on the quiz edit page
304
    And I click on shuffle for section "Heading 2" on the quiz edit page
305
    Then shuffle for section "Heading 1" should be "Off" on the quiz edit page
306
    And shuffle for section "Heading 2" should be "Off" on the quiz edit page
307
    And I reload the page
308
    And shuffle for section "Heading 1" should be "Off" on the quiz edit page
309
    And shuffle for section "Heading 2" should be "Off" on the quiz edit page
310
 
311
  @javascript
312
  Scenario: Add section heading option only appears for pages that are not the first in their section.
313
    Given the following "activities" exist:
314
      | activity   | name   | intro              | course | idnumber |
315
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
316
    And the following "questions" exist:
317
      | questioncategory | qtype       | name | questiontext    |
318
      | Test questions   | truefalse   | TF1  | This is question 01 |
319
      | Test questions   | truefalse   | TF2  | This is question 02 |
320
      | Test questions   | truefalse   | TF3  | This is question 03 |
321
    And quiz "Quiz 1" contains the following questions:
322
      | question | page |
323
      | TF1      | 1    |
324
      | TF2      | 1    |
325
      | TF3      | 2    |
326
    When I am on the "Quiz 1" "mod_quiz > Edit" page
327
    And I click on the "Add" page break icon after question "TF1"
328
    And I open the action menu in "Page 1" "list_item"
329
    Then "a new section heading" "link" in the "Page 1" "list_item" should not be visible
330
    # Click away to close the menu.
331
    And I click on ".numberofquestions" "css_element"
332
    And I open the action menu in "Page 2" "list_item"
333
    And "a new section heading" "link" in the "Page 2" "list_item" should be visible
334
    And I click on ".numberofquestions" "css_element"
335
    And I open the action menu in "Page 3" "list_item"
336
    And "a new section heading" "link" in the "Page 3" "list_item" should be visible
337
    And I click on ".numberofquestions" "css_element"
338
    And I open the action menu in ".last-add-menu" "css_element"
339
    And "a new section heading" "link" in the ".last-add-menu" "css_element" should not be visible
340
 
341
  @javascript
342
  Scenario: Verify sections are added in the right place afte ajax changes
343
    Given the following "activities" exist:
344
      | activity   | name   | intro              | course | idnumber |
345
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
346
    And the following "questions" exist:
347
      | questioncategory | qtype       | name | questiontext    |
348
      | Test questions   | truefalse   | TF1  | This is question 01 |
349
      | Test questions   | truefalse   | TF2  | This is question 02 |
350
      | Test questions   | truefalse   | TF3  | This is question 03 |
351
      | Test questions   | truefalse   | TF4  | This is question 04 |
352
    And quiz "Quiz 1" contains the following questions:
353
      | question | page |
354
      | TF1      | 1    |
355
      | TF2      | 2    |
356
      | TF3      | 3    |
357
      | TF4      | 4    |
358
 
359
    When I am on the "Quiz 1" "mod_quiz > Edit" page
360
    And I click on the "Remove" page break icon after question "TF1"
361
    And I open the "Page 2" add to quiz menu
362
    And I choose "a new section heading" in the open action menu
363
    Then "TF3" "list_item" should exist in the "New heading" "list_item"
364
 
365
  @javascript
366
  Scenario: Add section works after removing a page break with more than 10 pages
367
    Given the following "activities" exist:
368
      | activity   | name   | intro              | course | idnumber |
369
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
370
    And the following "questions" exist:
371
      | questioncategory | qtype       | name | questiontext |
372
      | Test questions   | truefalse   | TF1  | Question 1   |
373
      | Test questions   | truefalse   | TF2  | Question 2   |
374
      | Test questions   | truefalse   | TF3  | Question 3   |
375
      | Test questions   | truefalse   | TF4  | Question 4   |
376
      | Test questions   | truefalse   | TF5  | Question 5   |
377
      | Test questions   | truefalse   | TF6  | Question 6   |
378
      | Test questions   | truefalse   | TF7  | Question 7   |
379
      | Test questions   | truefalse   | TF8  | Question 8   |
380
      | Test questions   | truefalse   | TF9  | Question 9   |
381
      | Test questions   | truefalse   | TF10 | Question 10  |
382
      | Test questions   | truefalse   | TF11 | Question 11  |
383
    And quiz "Quiz 1" contains the following questions:
384
      | question | page |
385
      | TF1      | 1    |
386
      | TF2      | 2    |
387
      | TF3      | 3    |
388
      | TF4      | 4    |
389
      | TF5      | 5    |
390
      | TF6      | 6    |
391
      | TF7      | 7    |
392
      | TF8      | 8    |
393
      | TF9      | 9    |
394
      | TF10     | 10   |
395
      | TF11     | 11   |
396
    When I am on the "Quiz 1" "mod_quiz > Edit" page
397
    And I click on the "Remove" page break icon after question "TF10"
398
    And I open the "Page 10" add to quiz menu
399
    And I choose "a new section heading" in the open action menu
400
    Then "TF10" "list_item" should exist in the "New heading" "list_item"