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 - pagination
3
  In order to build a quiz laid out in pages the way I want
4
  As a teacher
5
  I need to be able to add and remove pages, and repaginate.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | T1        | Teacher1 | teacher1@example.com |
1441 ariadna 11
      | student1 | S1        | Student1 | student1@example.com |
1 efrain 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
      | student1 | C1     | student        |
1 efrain 19
    And the following "activities" exist:
1441 ariadna 20
      | activity   | name   | course | idnumber | questionsperpage | navmethod  |
21
      | quiz       | Quiz 1 | C1     | quiz1    | 0                | sequential |
22
    And the following "questions" exist:
23
      | questioncategory   | qtype     | name | questiontext    |
24
      | Default for Quiz 1 | truefalse | 1    | Question1 text  |
25
      | Default for Quiz 1 | truefalse | 2    | Question2 text  |
26
      | Default for Quiz 1 | truefalse | 3    | Question3 text  |
27
      | Default for Quiz 1 | truefalse | 4    | Question4 text  |
28
      | Default for Quiz 1 | truefalse | 5    | Question5 text  |
29
      | Default for Quiz 1 | truefalse | 6    | Question6 text  |
30
      | Default for Quiz 1 | truefalse | 7    | Question7 text  |
31
      | Default for Quiz 1 | truefalse | 8    | Question8 text  |
32
      | Default for Quiz 1 | truefalse | 9    | Question9 text  |
33
      | Default for Quiz 1 | truefalse | 10   | Question10 text |
34
    And quiz "Quiz 1" contains the following questions:
35
      | question | page |
36
      | 1        | 1    |
37
      | 2        | 1    |
38
      | 3        | 1    |
39
      | 4        | 1    |
40
      | 5        | 1    |
41
      | 6        | 1    |
42
      | 7        | 1    |
43
      | 8        | 1    |
44
      | 9        | 1    |
45
    And I am on the "Quiz 1" "mod_quiz > Edit" page logged in as teacher1
1 efrain 46
 
47
  @javascript
1441 ariadna 48
  Scenario: Repaginate questions using "add page break" or "Remove page break" icons
1 efrain 49
    # Start repaginating.
1441 ariadna 50
    When I click on the "Add" page break icon after question "Question1 text"
51
    # Confirm that only Question 1 is on quiz page 1.
52
    Then I should see "Question1 text" on quiz page "1"
53
    # Confirm that Question 2 ~ Question 9 are on quiz page 2.
54
    And I should see "Question2 text" on quiz page "2"
55
    And I should see "Question3 text" on quiz page "2"
56
    And I should see "Question4 text" on quiz page "2"
57
    And I should see "Question5 text" on quiz page "2"
58
    And I should see "Question6 text" on quiz page "2"
59
    And I should see "Question7 text" on quiz page "2"
60
    And I should see "Question8 text" on quiz page "2"
61
    And I should see "Question9 text" on quiz page "2"
1 efrain 62
 
1441 ariadna 63
    When I click on the "Remove" page break icon after question "Question1 text"
64
    # Confirm that all questions are on quiz page 1.
65
    Then I should see "Question1 text" on quiz page "1"
66
    And I should see "Question2 text" on quiz page "1"
67
    And I should see "Question3 text" on quiz page "1"
68
    And I should see "Question4 text" on quiz page "1"
69
    And I should see "Question5 text" on quiz page "1"
70
    And I should see "Question6 text" on quiz page "1"
71
    And I should see "Question7 text" on quiz page "1"
72
    And I should see "Question8 text" on quiz page "1"
73
    And I should see "Question9 text" on quiz page "1"
74
    # Confirm that there is no second page.
75
    And I should not see "Page 2" in the "region-main" "region"
1 efrain 76
 
1441 ariadna 77
    # Add a question.
78
    And I open the "last" add to quiz menu
79
    And I choose "from question bank" in the open action menu
80
    When I click on "Add to quiz" "link" in the "Question10 text" "table_row"
81
    # Confirm that all questions are on quiz page 1.
82
    Then I should see "Question1 text" on quiz page "1"
83
    And I should see "Question2 text" on quiz page "1"
84
    And I should see "Question3 text" on quiz page "1"
85
    And I should see "Question4 text" on quiz page "1"
86
    And I should see "Question5 text" on quiz page "1"
87
    And I should see "Question6 text" on quiz page "1"
88
    And I should see "Question7 text" on quiz page "1"
89
    And I should see "Question8 text" on quiz page "1"
90
    And I should see "Question9 text" on quiz page "1"
91
    And I should see "Question10 text" on quiz page "1"
92
    # Confirm that there is no second page.
93
    And I should not see "Page 2" in the "region-main" "region"
1 efrain 94
 
1441 ariadna 95
    When I click on the "Add" page break icon after question "Question2 text"
96
    # Confirm that Question 1 and Question 2 are on quiz page 1.
97
    Then I should see "Question1 text" on quiz page "1"
98
    And I should see "Question2 text" on quiz page "1"
99
    # Confirm that Question 3 ~ Question 10 are on quiz page 2.
100
    And I should see "Question3 text" on quiz page "2"
101
    And I should see "Question4 text" on quiz page "2"
102
    And I should see "Question5 text" on quiz page "2"
103
    And I should see "Question6 text" on quiz page "2"
104
    And I should see "Question7 text" on quiz page "2"
105
    And I should see "Question8 text" on quiz page "2"
106
    And I should see "Question9 text" on quiz page "2"
107
    And I should see "Question10 text" on quiz page "2"
108
    # Confirm that there is no third page.
109
    And I should not see "Page 3" in the "region-main" "region"
1 efrain 110
 
1441 ariadna 111
    When I click on the "Add" page break icon after question "Question1 text"
112
    # Confirm that only Question 1 is on quiz page 1.
113
    Then I should see "Question1 text" on quiz page "1"
114
    # Confirm that only Question 2 is on quiz page 2.
115
    And I should see "Question2 text" on quiz page "2"
116
    # Confirm that Question 3 ~ Question 10 are on quiz page 3.
117
    And I should see "Question3 text" on quiz page "3"
118
    And I should see "Question4 text" on quiz page "3"
119
    And I should see "Question5 text" on quiz page "3"
120
    And I should see "Question6 text" on quiz page "3"
121
    And I should see "Question7 text" on quiz page "3"
122
    And I should see "Question8 text" on quiz page "3"
123
    And I should see "Question9 text" on quiz page "3"
124
    And I should see "Question10 text" on quiz page "3"
1 efrain 125
 
1441 ariadna 126
    When I click on the "Remove" page break icon after question "Question2 text"
127
    # Confirm that only Question 1 is on quiz page 1.
128
    Then I should see "Question1 text" on quiz page "1"
129
    # Confirm that Question 2 ~ Question 10 are on quiz page 2.
130
    And I should see "Question2 text" on quiz page "2"
131
    And I should see "Question3 text" on quiz page "2"
132
    And I should see "Question4 text" on quiz page "2"
133
    And I should see "Question5 text" on quiz page "2"
134
    And I should see "Question6 text" on quiz page "2"
135
    And I should see "Question7 text" on quiz page "2"
136
    And I should see "Question8 text" on quiz page "2"
137
    And I should see "Question9 text" on quiz page "2"
138
    And I should see "Question10 text" on quiz page "2"
139
    # Confirm that there is no third page.
140
    And I should not see "Page 3" in the "region-main" "region"
1 efrain 141
 
1441 ariadna 142
    When I click on the "Remove" page break icon after question "Question1 text"
143
    # Confirm that all questions are on quiz page 1.
144
    Then I should see "Question1 text" on quiz page "1"
145
    And I should see "Question2 text" on quiz page "1"
146
    And I should see "Question3 text" on quiz page "1"
147
    And I should see "Question4 text" on quiz page "1"
148
    And I should see "Question5 text" on quiz page "1"
149
    And I should see "Question6 text" on quiz page "1"
150
    And I should see "Question7 text" on quiz page "1"
151
    And I should see "Question8 text" on quiz page "1"
152
    And I should see "Question9 text" on quiz page "1"
153
    And I should see "Question10 text" on quiz page "1"
154
    # Confirm that there is no second page.
155
    And I should not see "Page 2" in the "region-main" "region"
1 efrain 156
 
1441 ariadna 157
    # Repaginate to 1 question per page.
1 efrain 158
    When I press "Repaginate"
159
    And I set the field "menuquestionsperpage" to "1"
160
    And I click on "Go" "button" in the "Repaginate" "dialogue"
1441 ariadna 161
    # Confirm there is only 1 question per page - maximum of 10 pages.
162
    Then I should see "Question1 text" on quiz page "1"
163
    And I should see "Question2 text" on quiz page "2"
164
    And I should see "Question3 text" on quiz page "3"
165
    And I should see "Question4 text" on quiz page "4"
166
    And I should see "Question5 text" on quiz page "5"
167
    And I should see "Question6 text" on quiz page "6"
168
    And I should see "Question7 text" on quiz page "7"
169
    And I should see "Question8 text" on quiz page "8"
170
    And I should see "Question9 text" on quiz page "9"
171
    And I should see "Question10 text" on quiz page "10"
172
    # Confirm that there is no eleventh page.
173
    And I should not see "Page 11" in the "region-main" "region"
1 efrain 174
 
1441 ariadna 175
    # Repaginate to 2 questions per page.
1 efrain 176
    When I press "Repaginate"
177
    And I set the field "menuquestionsperpage" to "2"
178
    And I click on "Go" "button" in the "Repaginate" "dialogue"
1441 ariadna 179
    # Confirm there are only 2 questions per page - maximum of 5 pages.
180
    Then I should see "Question1 text" on quiz page "1"
181
    And I should see "Question2 text" on quiz page "1"
182
    And I should see "Question3 text" on quiz page "2"
183
    And I should see "Question4 text" on quiz page "2"
184
    And I should see "Question5 text" on quiz page "3"
185
    And I should see "Question6 text" on quiz page "3"
186
    And I should see "Question7 text" on quiz page "4"
187
    And I should see "Question8 text" on quiz page "4"
188
    And I should see "Question9 text" on quiz page "5"
189
    And I should see "Question10 text" on quiz page "5"
190
    # Confirm that there is no sixth page.
191
    And I should not see "Page 6" in the "region-main" "region"
1 efrain 192
 
1441 ariadna 193
    When I click on the "Add" page break icon after question "Question9 text"
194
    # Confirm there are only 2 questions per page until Question 8.
195
    Then I should see "Question1 text" on quiz page "1"
196
    And I should see "Question2 text" on quiz page "1"
197
    And I should see "Question3 text" on quiz page "2"
198
    And I should see "Question4 text" on quiz page "2"
199
    And I should see "Question5 text" on quiz page "3"
200
    And I should see "Question6 text" on quiz page "3"
201
    And I should see "Question7 text" on quiz page "4"
202
    And I should see "Question8 text" on quiz page "4"
203
    # Confirm only Question 9 is on quiz page 5.
204
    And I should see "Question9 text" on quiz page "5"
205
    # Confirm Question 10 is now on quiz page 6.
206
    And I should see "Question10 text" on quiz page "6"
207
 
1 efrain 208
    # Repaginate with unlimited questions per page (All questions on Page 1).
209
    When I press "Repaginate"
210
    And I set the field "menuquestionsperpage" to "Unlimited"
211
    And I click on "Go" "button" in the "Repaginate" "dialogue"
1441 ariadna 212
    # Confirm all questions are on page 1.
213
    Then I should see "Question1 text" on quiz page "1"
214
    And I should see "Question2 text" on quiz page "1"
215
    And I should see "Question3 text" on quiz page "1"
216
    And I should see "Question4 text" on quiz page "1"
217
    And I should see "Question5 text" on quiz page "1"
218
    And I should see "Question6 text" on quiz page "1"
219
    And I should see "Question7 text" on quiz page "1"
220
    And I should see "Question8 text" on quiz page "1"
221
    And I should see "Question9 text" on quiz page "1"
222
    And I should see "Question10 text" on quiz page "1"
223
    # Confirm that there is no second page.
224
    And I should not see "Page 2" in the "region-main" "region"
225
 
226
  @javascript
227
  Scenario: Teacher can repaginate questions using the move icon
228
    # Add page breaks.
229
    Given I click on the "Add" page break icon after question "Question3 text"
230
    And I click on the "Add" page break icon after question "Question7 text"
231
    # Move Question 6 after Question 3 using the move icon.
232
    When I move "Question6 text" to "After Question 3" in the quiz by clicking the move icon
233
    # Confirm that Question 6 moved to page 1 after Question 3.
234
    Then I should see "Question1 text" on quiz page "1"
235
    And I should see "Question2 text" on quiz page "1"
236
    And I should see "Question3 text" on quiz page "1"
237
    And I should see "Question6 text" on quiz page "1"
238
    # Confirm that Question 4, 5 and 7 remain on page 2.
239
    And I should see "Question4 text" on quiz page "2"
240
    And I should see "Question5 text" on quiz page "2"
241
    And I should see "Question7 text" on quiz page "2"
242
    # Confirm that Question 8 and 9 remain on page 3.
243
    And I should see "Question8 text" on quiz page "3"
244
    And I should see "Question9 text" on quiz page "3"
245
    # Move Question 7 and 1 after Question 9 using the move icon.
246
    When I move "Question7 text" to "After Question 9" in the quiz by clicking the move icon
247
    And I move "Question1 text" to "After Question 9" in the quiz by clicking the move icon
248
    # Confirm that Question 2, 3 and 6 remain on page 1.
249
    Then I should see "Question2 text" on quiz page "1"
250
    And I should see "Question3 text" on quiz page "1"
251
    And I should see "Question6 text" on quiz page "1"
252
    # Confirm that Question 4 and 5 remain on page 2.
253
    And I should see "Question4 text" on quiz page "2"
254
    And I should see "Question5 text" on quiz page "2"
255
    # Confirm that Question 8 and 9 remain on page 3.
256
    And I should see "Question8 text" on quiz page "3"
257
    And I should see "Question9 text" on quiz page "3"
258
    # Confirm that Question 7 and 1 moved to page 3 after Question 9.
259
    And I should see "Question7 text" on quiz page "3"
260
    And I should see "Question1 text" on quiz page "3"
261
 
262
  @javascript
263
  Scenario: Quiz questions are displayed on specified page when previewed and attempted
264
    # Add page breaks.
265
    Given I click on the "Add" page break icon after question "Question3 text"
266
    And I click on the "Add" page break icon after question "Question7 text"
267
    # Move Question 1 after Question 9 .
268
    And I move "Question1 text" to "After Question 9" in the quiz by clicking the move icon
269
    And I am on the "Quiz 1" "quiz activity" page
270
    When I press "Preview quiz"
271
    # Confirm the questions displayed per page when quiz is previewed.
272
    Then I should see "Question2 text"
273
    And I should see "Question3 text"
274
    And I press "Next page"
275
    And I should see "Question4 text"
276
    And I should see "Question5 text"
277
    And I should see "Question6 text"
278
    And I should see "Question7 text"
279
    And I press "Next page"
280
    And I should see "Question8 text"
281
    And I should see "Question9 text"
282
    And I should see "Question1 text"
283
    When I am on the "Quiz 1" "quiz activity" page logged in as student1
284
    # Confirm the questions displayed per page when quiz is attempted.
285
    And I press "Attempt quiz"
286
    Then I should see "Question2 text"
287
    And I should see "Question3 text"
288
    And I press "Next page"
289
    And I should see "Question4 text"
290
    And I should see "Question5 text"
291
    And I should see "Question6 text"
292
    And I should see "Question7 text"
293
    And I press "Next page"
294
    And I should see "Question8 text"
295
    And I should see "Question9 text"
296
    And I should see "Question1 text"