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 @quiz @quiz_overview @javascript
2
Feature: Regrading quiz attempts using the Grades report
3
    In order to be able to correct mistakes I made setting up my quiz
4
    As a teacher
5
    I need to be able to re-grade attempts after editing questions
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname  |
10
      | teacher  | Mark      | Allwright |
11
      | student1 | Student   | One       |
12
      | student2 | Student   | Two       |
13
      | student3 | Student   | Three     |
14
    And the following "courses" exist:
15
      | fullname | shortname | category |
16
      | Course 1 | C1        | 0        |
17
    And the following "course enrolments" exist:
18
      | user     | course | role           |
19
      | teacher  | C1     | editingteacher |
20
      | student1 | C1     | student        |
21
      | student2 | C1     | student        |
22
      | student3 | C1     | student        |
23
    And the following "activities" exist:
24
      | activity | name                       | course | idnumber |
25
      | quiz     | Quiz for testing regrading | C1     | quiz1    |
1441 ariadna 26
    And the following "question categories" exist:
27
      | contextlevel    | reference | name           |
28
      | Activity module | quiz1     | Test questions |
1 efrain 29
    And the following "questions" exist:
30
      | questioncategory | qtype       | name |
31
      | Test questions   | truefalse   | TF   |
32
      | Test questions   | shortanswer | SA   |
33
    And quiz "Quiz for testing regrading" contains the following questions:
34
      | question | page | maxmark |
35
      | TF       | 1    | 5.0     |
36
      | SA       | 1    | 5.0     |
37
    And user "student1" has attempted "Quiz for testing regrading" with responses:
38
      | slot | response |
39
      | 1    | True     |
40
      | 2    | frog     |
41
    And user "student2" has attempted "Quiz for testing regrading" with responses:
42
      | slot | response |
43
      | 1    | True     |
44
      | 2    | toad     |
45
 
1441 ariadna 46
  Scenario: Regrade all attempts and all questions.
1 efrain 47
    Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
48
    And I navigate to "Results" in current page administration
1441 ariadna 49
    And I press "Regrade attempts..."
50
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
1 efrain 51
    # Note, the order is not defined, so we can only check part of the message.
52
    # Also, nothing has changed in the quiz, so the regrade won't alter any scores,
53
    # but this is still a useful test that the regrade process completes without errors.
54
    Then I should see "Quiz for testing regrading"
55
    And I should see "Finished regrading (2/2)"
56
    And I should see "Regrade completed"
57
    And I press "Continue"
58
 
59
    # These next tests just serve to check we got back to the report.
60
    And I should see "Quiz for testing regrading"
61
    And I should see "Overall number of students achieving grade ranges"
62
 
1441 ariadna 63
  Scenario: Regrade selected attempts and all questions.
1 efrain 64
    Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
65
    And I navigate to "Results" in current page administration
66
    When I click on "Select attempt" "checkbox" in the "Student Two" "table_row"
1441 ariadna 67
    And I press "Regrade attempts..."
68
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
1 efrain 69
    Then I should see "Quiz for testing regrading"
70
    And I should see "Finished regrading (1/1)"
71
    And I should see "Regrade completed"
72
    And I press "Continue"
73
 
74
    # These next tests just serve to check we got back to the report.
75
    And I should see "Quiz for testing regrading"
76
    And I should see "Overall number of students achieving grade ranges"
77
 
1441 ariadna 78
  Scenario: Regrade all attempts and selected questions.
1 efrain 79
    Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
1441 ariadna 80
    When I follow "Edit question SA"
81
    And I set the field "id_fraction_1" to "50%"
82
    And I press "id_submitbutton"
83
    And I follow "Edit question TF"
84
    And I set the field "Correct answer" to "False"
85
    And I press "id_submitbutton"
86
    And I follow "Attempts: 2"
87
    And I press "Regrade attempts..."
88
    And I click on "Selected questions" "radio"
89
    And I click on "Question 1" "checkbox"
90
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
91
    Then I should see "Quiz for testing regrading"
92
    And I should see "Finished regrading (2/2)"
93
    And I should see "Regrade completed"
94
    And I press "Continue"
95
    And "Student OneReview attempt" row "Q. 1/50.00" column of "attempts" table should contain "50.00/0.00"
96
    And "Student TwoReview attempt" row "Q. 1/50.00" column of "attempts" table should contain "50.00/0.00"
97
    And "Student OneReview attempt" row "Grade/100.00" column of "attempts" table should contain "100.00/50.00"
98
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/40.00"
99
 
100
  Scenario: Regrade selected attempts and selected questions.
101
    Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
102
    When I follow "Edit question SA"
103
    And I set the field "id_fraction_1" to "50%"
104
    And I press "id_submitbutton"
105
    And I follow "Edit question TF"
106
    And I set the field "Correct answer" to "False"
107
    And I press "id_submitbutton"
108
    And I follow "Attempts: 2"
109
    And I click on "Select attempt" "checkbox" in the "Student Two" "table_row"
110
    And I press "Regrade attempts..."
111
    And the "Question 1" "checkbox" should be disabled
112
    And the "Question 2" "checkbox" should be disabled
113
    And I click on "Selected questions" "radio"
114
    And the "Question 1" "checkbox" should be enabled
115
    And the "Question 2" "checkbox" should be enabled
116
    And the "Regrade now" "button" should be disabled
117
    And the "Dry run" "button" should be disabled
118
    And I click on "Question 1" "checkbox"
119
    And the "Regrade now" "button" should be enabled
120
    And the "Dry run" "button" should be enabled
121
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
122
    Then I should see "Quiz for testing regrading"
123
    And I should see "Finished regrading (1/1)"
124
    And I should see "Regrade completed"
125
    And I press "Continue"
126
    And "Student TwoReview attempt" row "Q. 1/50.00" column of "attempts" table should contain "50.00/0.00"
127
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/40.00"
128
 
129
  Scenario: Dry-run all attempts, then regrade all attempts.
130
    Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
1 efrain 131
    And I follow "Edit question SA"
132
    And I set the field "id_fraction_1" to "50%"
133
    And I press "id_submitbutton"
134
    And I set the field "version" in the "TF" "list_item" to "v1"
135
    And I set the field "version" in the "SA" "list_item" to "v2 (latest)"
136
    And I follow "Attempts: 2"
1441 ariadna 137
    And I press "Regrade attempts..."
138
    And I click on "Dry run" "button" in the "Regrade" "dialogue"
1 efrain 139
    # Note, the order is not defined, so we can only check part of the message.
140
    Then I should see "Quiz for testing regrading"
141
    And I should see "Finished regrading (2/2)"
142
    And I should see "Regrade completed"
143
    And I press "Continue"
1441 ariadna 144
    And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
145
    And "Student TwoReview attempt" row "Regrade" column of "attempts" table should contain "Needed"
146
    # In the following, the first number is strike-through, and the second is not, but Behat can't see that.
147
    # At this point, it is showing what would change.
148
    And "Student TwoReview attempt" row "Q. 2/50.00" column of "attempts" table should contain "40.00/25.00"
149
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/75.00"
150
    And I press "Regrade attempts..."
151
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
152
    And I should see "Quiz for testing regrading"
153
    And I should see "Finished regrading (2/2)"
154
    And I should see "Regrade completed"
155
    And I press "Continue"
156
    # These next tests just serve to check we got back to the report.
157
    And I should see "Quiz for testing regrading"
158
    And I should see "Overall number of students achieving grade ranges"
159
    # Now, both old-score strike-through and new score plain, are still shown, but now it indicates what did change.
160
    And "Student TwoReview attempt" row "Q. 2/50.00" column of "attempts" table should contain "40.00/25.00"
161
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/75.00"
1 efrain 162
 
1441 ariadna 163
  Scenario: Dry-run a full regrade, then regrade the commit regrade.
164
    Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
165
    When I follow "Edit question SA"
166
    And I set the field "id_fraction_1" to "50%"
167
    And I press "id_submitbutton"
168
    And I set the field "version" in the "TF" "list_item" to "v1"
169
    And I set the field "version" in the "SA" "list_item" to "v2 (latest)"
170
    And I follow "Attempts: 2"
171
    And I press "Regrade attempts..."
172
    And I click on "Dry run" "button" in the "Regrade" "dialogue"
173
    # Note, the order is not defined, so we can only check part of the message.
174
    And I should see "Quiz for testing regrading"
175
    And I should see "Finished regrading (2/2)"
176
    And I should see "Regrade completed"
177
    And I press "Continue"
1 efrain 178
    And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
179
    And "Student TwoReview attempt" row "Regrade" column of "attempts" table should contain "Needed"
180
    # In the following, the first number is strike-through, and the second is not, but Behat can't see that.
181
    # At this point, it is showing what would change.
1441 ariadna 182
    And "Student TwoReview attempt" row "Q. 2/50.00" column of "attempts" table should contain "40.00/25.00"
183
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/75.00"
184
    Then I should see "The last dry run of a regrade found that the regrade would change the marks for 1 questions in 1 attempts."
185
    And I press "Commit regrade"
1 efrain 186
    And I should see "Quiz for testing regrading"
187
    And I should see "Finished regrading (1/1)"
188
    And I should see "Regrade completed"
189
    And I press "Continue"
190
 
191
    # These next tests just serve to check we got back to the report.
192
    And I should see "Quiz for testing regrading"
193
    And I should see "Overall number of students achieving grade ranges"
194
    # Now, both old-score strike-through and new score plain, are still shown, but now it indicates what did change.
1441 ariadna 195
    And "Student TwoReview attempt" row "Q. 2/50.00" column of "attempts" table should contain "40.00/25.00"
196
    And "Student TwoReview attempt" row "Grade/100.00" column of "attempts" table should contain "90.00/75.00"
197
    And I should not see "The last dry run of a regrade found that the regrade would change the marks for 1 questions in 1 attempts."
1 efrain 198
 
199
  Scenario: Regrade all attempts works against quiz selected question version
200
    Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
201
    And I navigate to "Results" in current page administration
1441 ariadna 202
    And I press "Regrade attempts..."
203
    And I click on "Dry run" "button" in the "Regrade" "dialogue"
1 efrain 204
    Then I should see "Quiz for testing regrading"
205
    And I should see "Finished regrading (2/2)"
206
    And I should see "Regrade completed"
207
    And I press "Continue"
208
    And I should see "Quiz for testing regrading"
209
    And I should see "Overall number of students achieving grade ranges"
210
    And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
211
    And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
1441 ariadna 212
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 213
    And I choose "Edit question" action for "TF" in the question bank
214
    And I set the field "Correct answer" to "False"
215
    And I press "id_submitbutton"
216
    And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
217
    And I set the field "version" in the "TF" "list_item" to "v2 (latest)"
218
    And I navigate to "Results" in current page administration
1441 ariadna 219
    And I press "Regrade attempts..."
220
    And I click on "Dry run" "button" in the "Regrade" "dialogue"
1 efrain 221
    And I should see "Regrade completed"
222
    And I press "Continue"
223
    And "student1@example.com" row "Regrade" column of "attempts" table should contain "Needed"
224
    And "Correct" "icon" should appear before "50.00/0.00" "text"
1441 ariadna 225
    And I press "Regrade attempts..."
226
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
1 efrain 227
    And I should see "Regrade completed"
228
    And I press "Continue"
229
    Then "student1@example.com" row "Regrade" column of "attempts" table should contain "Done"
1441 ariadna 230
    And "Student OneReview attempt" row "Q. 1/50.00" column of "attempts" table should contain "50.00/0.00"
1 efrain 231
    And "Incorrect" "icon" should appear before "50.00/0.00" "text"
232
 
233
  Scenario: Regrade all attempts works against quiz selected latest question version
234
    Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
235
    And I navigate to "Results" in current page administration
236
    And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
237
    And I click on "Delete selected attempts" "button"
238
    And I click on "Yes" "button"
239
    And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
240
    And I should see "(latest)" in the "TF" "list_item"
241
    # Create multiple question versions.
242
    And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
1441 ariadna 243
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 244
    And I choose "Edit question" action for "TF" in the question bank
245
    And I set the field "Correct answer" to "True"
246
    And I press "id_submitbutton"
247
    And I choose "Edit question" action for "TF" in the question bank
248
    And I set the field "Question name" to "New version of TF"
249
    And I set the field "Correct answer" to "False"
250
    And I press "id_submitbutton"
251
    And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
252
    And I should see "(latest)" in the "TF" "list_item"
253
    And I click on "version" "select" in the "TF" "list_item"
254
    And I should see "v1"
255
    And I should see "v2"
256
    And I should see "v3 (latest)"
257
    # Set version that is going to be attempted to an older one.
258
    And I set the field "version" in the "TF" "list_item" to "v1"
259
    And user "student3" has attempted "Quiz for testing regrading" with responses:
260
      | slot | response |
261
      | 1    | True     |
262
      | 2    | toad     |
263
    And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
264
    And I set the field "version" in the "TF" "list_item" to "Always latest"
265
    And I navigate to "Results" in current page administration
1441 ariadna 266
    And I press "Regrade attempts..."
267
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
1 efrain 268
    And I should see "Finished regrading (1/1)"
269
    And I should see "Regrade completed"
270
    And I press "Continue"
1441 ariadna 271
    Then "student3@example.com" row "Q. 1/50.00" column of "attempts" table should contain "50.00/0.00"
1 efrain 272
    And "Incorrect" "icon" should appear before "50.00/0.00" "text"
273
 
274
  Scenario: Regrade attempts should always regrade against latest random question version
275
    Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
276
    And I navigate to "Results" in current page administration
277
    And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
278
    And I click on "Delete selected attempts" "button"
279
    And I click on "Yes" "button"
280
    # Create multiple question versions.
281
    And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
1441 ariadna 282
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 283
    And I choose "Delete" action for "SA" in the question bank
284
    And I press "Delete"
285
    And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
286
    And I click on "Delete" "link" in the "TF" "list_item"
287
    And I click on "Yes" "button" in the "Confirm" "dialogue"
288
    And I click on "Delete" "link" in the "SA" "list_item"
289
    And I click on "Yes" "button" in the "Confirm" "dialogue"
290
    And I click on "Add" "link"
291
    And I follow "a random question"
1441 ariadna 292
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 293
    And I press "Add random question"
294
    And I am on the "Quiz for testing regrading" "quiz activity" page logged in as student3
295
    And I click on "Attempt quiz" "button"
296
    And I should see "The answer is true."
297
    And I set the field "True" to "1"
298
    And I click on "Finish attempt ..." "button"
299
    And I press "Submit all and finish"
300
    And I click on "Submit" "button" in the "Submit all your answers and finish?" "dialogue"
301
    And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page logged in as teacher
1441 ariadna 302
    And I apply question bank filter "Category" with value "Test questions"
1 efrain 303
    And I choose "Edit question" action for "TF" in the question bank
304
    And I set the field "Correct answer" to "False"
305
    And I press "id_submitbutton"
306
    And I navigate to "Results" in current page administration
1441 ariadna 307
    And "student3@example.com" row "Q. 1/100.00" column of "attempts" table should contain "100.00"
1 efrain 308
    And "Correct" "icon" should be visible
1441 ariadna 309
    And I press "Regrade attempts..."
310
    And I click on "Regrade now" "button" in the "Regrade" "dialogue"
1 efrain 311
    And I should see "Finished regrading (1/1)"
312
    And I should see "Regrade completed"
313
    And I press "Continue"
1441 ariadna 314
    Then "student3@example.com" row "Q. 1/100.00" column of "attempts" table should contain "100.00/0.00"
1 efrain 315
    And "Incorrect" "icon" should be visible