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