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_feedback
2
Feature: Testing multichoice questions in feedback
3
  In order to create feedbacks
4
  As a teacher
5
  I need to be able to create different types of multichoice questions
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname |
10
      | teacher1 | Teacher   | 1        |
11
      | student1 | Student   | 1        |
12
      | student2 | Student   | 2        |
13
    And the following "courses" exist:
14
      | fullname | shortname |
15
      | Course 1 | C1        |
16
    And the following "course enrolments" exist:
17
      | user     | course | role           |
18
      | teacher1 | C1     | editingteacher |
19
      | student1 | C1     | student        |
20
      | student2 | C1     | student        |
21
    And the following "activities" exist:
22
      | activity   | name                | course | idnumber    |
23
      | feedback   | Learning experience | C1     | feedback0   |
24
    And I am on the "Learning experience" "feedback activity" page logged in as teacher1
1441 ariadna 25
    And I navigate to "Questions" in current page administration
1 efrain 26
 
27
  @javascript
28
  Scenario: Non-rated single-answer multiple choice questions in feedback
29
    When I add a "Multiple choice" question to the feedback with:
30
      | Question         | this is a multiple choice 1 |
31
      | Label            | multichoice1                |
32
      | Multiple choice type | Multiple choice - single answer |
33
      | Multiple choice values | option a\noption b\noption c  |
34
    And I add a "Text and media area" question to the feedback with:
35
      | Contents | this is the first page of the feedback |
1441 ariadna 36
    And I add a page break to the feedback
1 efrain 37
    And I add a "Multiple choice" question to the feedback with:
38
      | Question         | this is a multiple choice 2 |
39
      | Label            | multichoice2                |
40
      | Multiple choice type | Multiple choice - single answer |
41
      | Multiple choice values | option d\noption e\noption f  |
42
      | Required | 1 |
43
    And I add a "Text and media area" question to the feedback with:
44
      | Contents | this is the second page of the feedback |
1441 ariadna 45
    And I add a page break to the feedback
1 efrain 46
    And I add a "Multiple choice" question to the feedback with:
47
      | Question         | this is a multiple choice 3 |
48
      | Label            | multichoice3                |
49
      | Multiple choice type | Multiple choice - single answer |
50
      | Multiple choice values | option g\noption h\noption i  |
51
      | Hide the "Not selected" option | Yes                   |
52
      | Dependence item                | multichoice2          |
53
      | Dependence value               | option d              |
54
    And I add a "Text and media area" question to the feedback with:
55
      | Contents | this is the third page of the feedback |
56
    And I log out
57
    And I am on the "Learning experience" "feedback activity" page logged in as student1
58
    And I follow "Answer the questions"
59
    # Examine the first page, select nothing, go to the next page
60
    Then the following fields match these values:
61
      | Not selected | 1 |
62
      | option a     | 0 |
63
      | option b     | 0 |
64
      | option c     | 0 |
65
    And "Previous page" "button" should not exist
66
    And "Submit your answers" "button" should not exist
67
    And I should see "this is the first page of the feedback"
68
    And I should not see "this is the second page of the feedback"
69
    And I should not see "this is the third page of the feedback"
70
    And I press "Next page"
71
    # Examine the second page, select nothing, try to go to the next page
72
    And I should see "Not selected"
73
    And the following fields match these values:
74
      | Not selected | 1 |
75
      | option d     | 0 |
76
      | option e     | 0 |
77
      | option f     | 0 |
78
    And "Previous page" "button" should exist
79
    And "Submit your answers" "button" should not exist
80
    And I should not see "this is the first page of the feedback"
81
    And I should see "this is the second page of the feedback"
82
    And I should not see "this is the third page of the feedback"
83
    And I press "Next page"
84
    # We are still on the second page because the field is required
85
    And I should see "Required" in the "form" "css_element"
86
    And I should see "this is the second page of the feedback"
87
    And I set the field "option e" to "1"
88
    And the following fields match these values:
89
      | Not selected | 0 |
90
      | option d     | 0 |
91
      | option e     | 1 |
92
      | option f     | 0 |
93
    And I press "Next page"
94
    # Now we are on the third page, element is not shown because of wrong dependency.
95
    And I should see "this is the third page of the feedback"
96
    And I should not see "this is a multiple choice 3"
97
    # Go back, check that values are preserved and change the option to enable dependency.
98
    And I press "Previous page"
99
    And the following fields match these values:
100
      | Not selected | 0 |
101
      | option d     | 0 |
102
      | option e     | 1 |
103
      | option f     | 0 |
104
    And I set the field "option d" to "1"
105
    And I press "Next page"
106
    # Now third page contains all items.
107
    And I should see "this is a multiple choice 3"
108
    And I should see "this is the third page of the feedback"
109
    And I should not see "Not selected"
110
    And the following fields match these values:
111
      | option g     | 0 |
112
      | option h     | 0 |
113
      | option i     | 0 |
114
    And "Previous page" "button" should exist
115
    And "Next page" "button" should not exist
116
    And "Submit your answers" "button" should exist
117
    And I set the field "option i" to "1"
118
    And I press "Submit your answers"
119
    And I log out
120
    # Student 2 tries to trick - he answers the third question and then
121
    # goes back and changes dependency question. Analysis should not show this answer!
122
    And I am on the "Learning experience" "feedback activity" page logged in as student2
123
    And I follow "Answer the questions"
124
    And I set the field "option a" to "1"
125
    And I press "Next page"
126
    And I set the field "option d" to "1"
127
    And I press "Next page"
128
    And I set the field "option g" to "1"
129
    And I press "Previous page"
130
    And I set the field "option f" to "1"
131
    And I press "Next page"
132
    And I press "Submit your answers"
133
    And I log out
134
    # Login as teacher and check analysis
135
    And I am on the "Learning experience" "feedback activity" page logged in as teacher1
136
    And I navigate to "Analysis" in current page administration
137
    And I should see "Submitted answers: 2"
138
    And I should see "Questions: 3"
139
    And I show chart data for the "multichoice1" feedback
140
    And I should see "1 (50.00 %)" in the "option a" "table_row"
141
    And I should not see "%" in the "option b" "table_row"
142
    And I should not see "%" in the "option c" "table_row"
143
    And I show chart data for the "multichoice2" feedback
144
    And I should see "1 (50.00 %)" in the "option d" "table_row"
145
    And I should not see "%" in the "option e" "table_row"
146
    And I should see "1 (50.00 %)" in the "option f" "table_row"
147
    And I show chart data for the "multichoice3" feedback
148
    And I should not see "%" in the "option g" "table_row"
149
    And I should not see "%" in the "option h" "table_row"
150
    And I should see "1 (100.00 %)" in the "option i" "table_row"
151
    # Change the settings so we don't analyse empty submits
152
    And I am on the "Learning experience" "feedback activity" page
1441 ariadna 153
    And I navigate to "Questions" in current page administration
154
    And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
1 efrain 155
    And I choose "Edit question" in the open action menu
156
    And I set the field "Omit empty submits in analysis" to "Yes"
157
    And I press "Save changes to question"
158
    And I am on the "Learning experience" "feedback activity" page
159
    And I navigate to "Analysis" in current page administration
160
    And I show chart data for the "multichoice1" feedback
161
    And I should see "1 (100.00 %)" in the "option a" "table_row"
162
    And I should not see "%" in the "option b" "table_row"
163
    And I should not see "%" in the "option c" "table_row"
164
 
165
  @javascript
166
  Scenario: Non-rated multiple-answers multiple choice questions in feedback
167
    # Create a feedback with three pages, required and dependent questions.
168
    When I add a "Multiple choice" question to the feedback with:
169
      | Question         | this is a multiple choice 1 |
170
      | Label            | multichoice1                |
171
      | Multiple choice type | Multiple choice - multiple answers |
172
      | Multiple choice values | option a\noption b\noption c  |
173
    And I add a "Text and media area" question to the feedback with:
174
      | Contents | this is the first page of the feedback |
1441 ariadna 175
    And I add a page break to the feedback
1 efrain 176
    And I add a "Multiple choice" question to the feedback with:
177
      | Question         | this is a multiple choice 2 |
178
      | Label            | multichoice2                |
179
      | Multiple choice type | Multiple choice - multiple answers |
180
      | Multiple choice values | option d\noption e\noption f  |
181
      | Required | 1 |
182
    And I add a "Text and media area" question to the feedback with:
183
      | Contents | this is the second page of the feedback |
1441 ariadna 184
    And I add a page break to the feedback
1 efrain 185
    And I add a "Multiple choice" question to the feedback with:
186
      | Question         | this is a multiple choice 3 |
187
      | Label            | multichoice3                |
188
      | Multiple choice type | Multiple choice - multiple answers |
189
      | Multiple choice values | option g\noption h\noption i  |
190
      | Dependence item                | multichoice2          |
191
      | Dependence value               | option d              |
192
    And I add a "Text and media area" question to the feedback with:
193
      | Contents | this is the third page of the feedback |
194
    And I log out
195
    # Login as the first student.
196
    And I am on the "Learning experience" "feedback activity" page logged in as student1
197
    And I follow "Answer the questions"
198
    # Examine the first page, select nothing, go to the next page
199
    And I should not see "Not selected"
200
    And the following fields match these values:
201
      | option a     | 0 |
202
      | option b     | 0 |
203
      | option c     | 0 |
204
    And "Previous page" "button" should not exist
205
    And "Submit your answers" "button" should not exist
206
    And I should see "this is the first page of the feedback"
207
    And I should not see "this is the second page of the feedback"
208
    And I should not see "this is the third page of the feedback"
209
    And I press "Next page"
210
    # Examine the second page, select nothing, try to go to the next page
211
    Then I should not see "Not selected"
212
    And the following fields match these values:
213
      | option d     | 0 |
214
      | option e     | 0 |
215
      | option f     | 0 |
216
    And "Previous page" "button" should exist
217
    And "Submit your answers" "button" should not exist
218
    And I should not see "this is the first page of the feedback"
219
    And I should see "this is the second page of the feedback"
220
    And I should not see "this is the third page of the feedback"
221
    And I press "Next page"
222
    # We are still on the second page because the field is required
223
    And I should see "Required" in the "form" "css_element"
224
    And I should see "this is the second page of the feedback"
225
    And I set the field "option e" to "1"
226
    And I set the field "option f" to "1"
227
    And the following fields match these values:
228
      | option d     | 0 |
229
      | option e     | 1 |
230
      | option f     | 1 |
231
    And I press "Next page"
232
    # Now we are on the third page, element is not shown because of wrong dependency.
233
    And I should see "this is the third page of the feedback"
234
    And I should not see "this is a multiple choice 3"
235
    # Go back, check that values are preserved and change the option to enable dependency.
236
    And I press "Previous page"
237
    And the following fields match these values:
238
      | option d     | 0 |
239
      | option e     | 1 |
240
      | option f     | 1 |
241
    And I set the field "option d" to "1"
242
    And I set the field "option e" to "0"
243
    And I press "Next page"
244
    # Now third page contains all items.
245
    And I should see "this is a multiple choice 3"
246
    And I should see "this is the third page of the feedback"
247
    And the following fields match these values:
248
      | option g     | 0 |
249
      | option h     | 0 |
250
      | option i     | 0 |
251
    And "Previous page" "button" should exist
252
    And "Next page" "button" should not exist
253
    And "Submit your answers" "button" should exist
254
    And I set the field "option i" to "1"
255
    And I press "Submit your answers"
256
    And I log out
257
    # Student 2 tries to trick - he answers the third question and then
258
    # goes back and changes dependency question. Analysis should not show this answer!
259
    And I am on the "Learning experience" "feedback activity" page logged in as student2
260
    And I follow "Answer the questions"
261
    And I set the field "option a" to "1"
262
    And I set the field "option b" to "1"
263
    And I press "Next page"
264
    And I set the field "option d" to "1"
265
    And I press "Next page"
266
    And I set the field "option g" to "1"
267
    And I press "Previous page"
268
    And I set the field "option d" to "0"
269
    And I set the field "option f" to "1"
270
    And I press "Next page"
271
    And I press "Submit your answers"
272
    And I log out
273
    # Login as teacher and check analysis
274
    And I am on the "Learning experience" "feedback activity" page logged in as teacher1
275
    And I navigate to "Analysis" in current page administration
276
    And I should see "Submitted answers: 2"
277
    And I should see "Questions: 3"
278
    And I show chart data for the "multichoice1" feedback
279
    And I should see "1 (50.00 %)" in the "option a" "table_row"
280
    And I should see "1 (50.00 %)" in the "option b" "table_row"
281
    And I should not see "%" in the "option c" "table_row"
282
    And I show chart data for the "multichoice2" feedback
283
    And I should see "1 (50.00 %)" in the "option d" "table_row"
284
    And I should not see "%" in the "option e" "table_row"
285
    And I should see "2 (100.00 %)" in the "option f" "table_row"
286
    And I show chart data for the "multichoice3" feedback
287
    And I should not see "%" in the "option g" "table_row"
288
    And I should not see "%" in the "option h" "table_row"
289
    And I should see "1 (100.00 %)" in the "option i" "table_row"
290
    # Change the settings so we don't analyse empty submits
291
    And I am on the "Learning experience" "feedback activity" page
1441 ariadna 292
    And I navigate to "Questions" in current page administration
293
    And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
1 efrain 294
    And I choose "Edit question" in the open action menu
295
    And I set the field "Omit empty submits in analysis" to "Yes"
296
    And I press "Save changes to question"
297
    And I am on the "Learning experience" "feedback activity" page
298
    And I navigate to "Analysis" in current page administration
299
    And I show chart data for the "multichoice1" feedback
300
    And I should see "1 (100.00 %)" in the "option a" "table_row"
301
    And I should see "1 (100.00 %)" in the "option b" "table_row"
302
    And I should not see "%" in the "option c" "table_row"
303
 
304
  @javascript
305
  Scenario: Non-rated single-answer dropdown multiple choice questions in feedback
306
    When I add a "Multiple choice" question to the feedback with:
307
      | Question         | this is a multiple choice 1 |
308
      | Label            | multichoice1                |
309
      | Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
310
      | Multiple choice values | option a\noption b\noption c  |
311
    And I add a "Text and media area" question to the feedback with:
312
      | Contents | this is the first page of the feedback |
1441 ariadna 313
    And I add a page break to the feedback
1 efrain 314
    And I add a "Multiple choice" question to the feedback with:
315
      | Question         | this is a multiple choice 2 |
316
      | Label            | multichoice2                |
317
      | Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
318
      | Multiple choice values | option d\noption e\noption f  |
319
      | Required | 1 |
320
    And I add a "Text and media area" question to the feedback with:
321
      | Contents | this is the second page of the feedback |
1441 ariadna 322
    And I add a page break to the feedback
1 efrain 323
    And I add a "Multiple choice" question to the feedback with:
324
      | Question         | this is a multiple choice 3 |
325
      | Label            | multichoice3                |
326
      | Multiple choice type | Multiple choice - single answer allowed (drop-down menu) |
327
      | Multiple choice values | option g\noption h\noption i  |
328
      | Dependence item                | multichoice2          |
329
      | Dependence value               | option d              |
330
    And I add a "Text and media area" question to the feedback with:
331
      | Contents | this is the third page of the feedback |
332
    And I log out
333
    And I am on the "Learning experience" "feedback activity" page logged in as student1
334
    And I follow "Answer the questions"
335
    # Examine the first page, select nothing, go to the next page
336
    Then the following fields match these values:
337
      | this is a multiple choice 1 | 0 |
338
    And "Previous page" "button" should not exist
339
    And "Submit your answers" "button" should not exist
340
    And I should see "this is the first page of the feedback"
341
    And I should not see "this is the second page of the feedback"
342
    And I should not see "this is the third page of the feedback"
343
    And I press "Next page"
344
    # Examine the second page, select nothing, try to go to the next page
345
    And the following fields match these values:
346
      | this is a multiple choice 2 | 0 |
347
    And "Previous page" "button" should exist
348
    And "Submit your answers" "button" should not exist
349
    And I should not see "this is the first page of the feedback"
350
    And I should see "this is the second page of the feedback"
351
    And I should not see "this is the third page of the feedback"
352
    And I press "Next page"
353
    # We are still on the second page because the field is required
354
    And I should see "Required" in the "form" "css_element"
355
    And I should see "this is the second page of the feedback"
356
    And I set the field "this is a multiple choice 2" to "option e"
357
    And I press "Next page"
358
    # Now we are on the third page, element is not shown because of wrong dependency.
359
    And I should see "this is the third page of the feedback"
360
    And I should not see "this is a multiple choice 3"
361
    # Go back, check that values are preserved and change the option to enable dependency.
362
    And I press "Previous page"
363
    And the following fields match these values:
364
      | this is a multiple choice 2 | option e |
365
    And I set the field "this is a multiple choice 2" to "option d"
366
    And I press "Next page"
367
    # Now third page contains all items.
368
    And I should see "this is the third page of the feedback"
369
    And the following fields match these values:
370
      | this is a multiple choice 3 | 0 |
371
    And "Previous page" "button" should exist
372
    And "Next page" "button" should not exist
373
    And "Submit your answers" "button" should exist
374
    And I set the field "this is a multiple choice 3" to "option i"
375
    And I press "Submit your answers"
376
    And I log out
377
    # Student 2 tries to trick - he answers the third question and then
378
    # goes back and changes dependency question. Analysis should not show this answer!
379
    And I am on the "Learning experience" "feedback activity" page logged in as student2
380
    And I follow "Answer the questions"
381
    And I set the field "this is a multiple choice 1" to "option a"
382
    And I press "Next page"
383
    And I set the field "this is a multiple choice 2" to "option d"
384
    And I press "Next page"
385
    And I set the field "this is a multiple choice 3" to "option g"
386
    And I press "Previous page"
387
    And I set the field "this is a multiple choice 2" to "option f"
388
    And I press "Next page"
389
    And I press "Submit your answers"
390
    And I log out
391
    # Login as teacher and check analysis
392
    And I am on the "Learning experience" "feedback activity" page logged in as teacher1
393
    And I navigate to "Analysis" in current page administration
394
    And I should see "Submitted answers: 2"
395
    And I should see "Questions: 3"
396
    And I show chart data for the "multichoice1" feedback
397
    And I should see "1 (50.00 %)" in the "option a" "table_row"
398
    And I should not see "%" in the "option b" "table_row"
399
    And I should not see "%" in the "option c" "table_row"
400
    And I show chart data for the "multichoice2" feedback
401
    And I should see "1 (50.00 %)" in the "option d" "table_row"
402
    And I should not see "%" in the "option e" "table_row"
403
    And I should see "1 (50.00 %)" in the "option f" "table_row"
404
    And I show chart data for the "multichoice3" feedback
405
    And I should not see "%" in the "option g" "table_row"
406
    And I should not see "%" in the "option h" "table_row"
407
    And I should see "1 (100.00 %)" in the "option i" "table_row"
408
    # Change the settings so we don't analyse empty submits
409
    And I am on the "Learning experience" "feedback activity" page
1441 ariadna 410
    And I navigate to "Questions" in current page administration
411
    And I click on "Edit" "link" in the "this is a multiple choice 1" "mod_feedback > Question"
1 efrain 412
    And I choose "Edit question" in the open action menu
413
    And I set the field "Omit empty submits in analysis" to "Yes"
414
    And I press "Save changes to question"
415
    And I am on the "Learning experience" "feedback activity" page
416
    And I navigate to "Analysis" in current page administration
417
    And I show chart data for the "multichoice1" feedback
418
    And I should see "1 (100.00 %)" in the "option a" "table_row"
419
    And I should not see "%" in the "option b" "table_row"
420
    And I should not see "%" in the "option c" "table_row"