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 "question categories" exist:
|
|
|
24 |
| contextlevel | reference | name |
|
|
|
25 |
| Course | C1 | Test questions |
|
|
|
26 |
And the following "activities" exist:
|
|
|
27 |
| activity | name | course | idnumber |
|
|
|
28 |
| quiz | Quiz for testing regrading | C1 | quiz1 |
|
|
|
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 |
|
|
|
46 |
Scenario: Regrade all attempts
|
|
|
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
|
|
|
49 |
When I press "Regrade all"
|
|
|
50 |
|
|
|
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 |
|
|
|
63 |
Scenario: Regrade selected attempts
|
|
|
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"
|
|
|
67 |
|
|
|
68 |
And I press "Regrade selected attempts"
|
|
|
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 |
|
|
|
78 |
Scenario: Dry-run a full regrade, then regrade the attempts that will need it.
|
|
|
79 |
Given I am on the "Quiz for testing regrading" "mod_quiz > edit" page logged in as teacher
|
|
|
80 |
And 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 set the field "version" in the "TF" "list_item" to "v1"
|
|
|
84 |
And I set the field "version" in the "SA" "list_item" to "v2 (latest)"
|
|
|
85 |
And I follow "Attempts: 2"
|
|
|
86 |
And I press "Dry run a full regrade"
|
|
|
87 |
|
|
|
88 |
# Note, the order is not defined, so we can only check part of the message.
|
|
|
89 |
Then I should see "Quiz for testing regrading"
|
|
|
90 |
And I should see "Finished regrading (2/2)"
|
|
|
91 |
And I should see "Regrade completed"
|
|
|
92 |
And I press "Continue"
|
|
|
93 |
|
|
|
94 |
And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
|
|
|
95 |
And "Student TwoReview attempt" row "Regrade" column of "attempts" table should contain "Needed"
|
|
|
96 |
# In the following, the first number is strike-through, and the second is not, but Behat can't see that.
|
|
|
97 |
# At this point, it is showing what would change.
|
|
|
98 |
And "Student TwoReview attempt" row "Q. 2/50.00Sort by Q. 2/50.00 Ascending" column of "attempts" table should contain "40.00/25.00"
|
|
|
99 |
And "Student TwoReview attempt" row "Grade/100.00Sort by Grade/100.00 Ascending" column of "attempts" table should contain "90.00/75.00"
|
|
|
100 |
And I press "Regrade attempts marked as needing regrading (1)"
|
|
|
101 |
And I should see "Quiz for testing regrading"
|
|
|
102 |
And I should see "Finished regrading (1/1)"
|
|
|
103 |
And I should see "Regrade completed"
|
|
|
104 |
And I press "Continue"
|
|
|
105 |
|
|
|
106 |
# These next tests just serve to check we got back to the report.
|
|
|
107 |
And I should see "Quiz for testing regrading"
|
|
|
108 |
And I should see "Overall number of students achieving grade ranges"
|
|
|
109 |
# Now, both old-score strike-through and new score plain, are still shown, but now it indicates what did change.
|
|
|
110 |
And "Student TwoReview attempt" row "Q. 2/50.00Sort by Q. 2/50.00 Ascending" column of "attempts" table should contain "40.00/25.00"
|
|
|
111 |
And "Student TwoReview attempt" row "Grade/100.00Sort by Grade/100.00 Ascending" column of "attempts" table should contain "90.00/75.00"
|
|
|
112 |
And "Regrade attempts marked as needing regrading" "button" should not exist
|
|
|
113 |
|
|
|
114 |
Scenario: Regrade all attempts works against quiz selected question version
|
|
|
115 |
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
|
|
116 |
And I navigate to "Results" in current page administration
|
|
|
117 |
When I press "Dry run a full regrade"
|
|
|
118 |
Then I should see "Quiz for testing regrading"
|
|
|
119 |
And I should see "Finished regrading (2/2)"
|
|
|
120 |
And I should see "Regrade completed"
|
|
|
121 |
And I press "Continue"
|
|
|
122 |
And I should see "Quiz for testing regrading"
|
|
|
123 |
And I should see "Overall number of students achieving grade ranges"
|
|
|
124 |
And "Student One" row "Regrade" column of "attempts" table should not contain "Needed"
|
|
|
125 |
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
|
|
126 |
And I choose "Edit question" action for "TF" in the question bank
|
|
|
127 |
And I set the field "Correct answer" to "False"
|
|
|
128 |
And I press "id_submitbutton"
|
|
|
129 |
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
|
|
130 |
And I set the field "version" in the "TF" "list_item" to "v2 (latest)"
|
|
|
131 |
And I navigate to "Results" in current page administration
|
|
|
132 |
And I press "Dry run a full regrade"
|
|
|
133 |
And I should see "Regrade completed"
|
|
|
134 |
And I press "Continue"
|
|
|
135 |
And "student1@example.com" row "Regrade" column of "attempts" table should contain "Needed"
|
|
|
136 |
And "Correct" "icon" should appear before "50.00/0.00" "text"
|
|
|
137 |
And I press "Regrade all"
|
|
|
138 |
And I should see "Regrade completed"
|
|
|
139 |
And I press "Continue"
|
|
|
140 |
Then "student1@example.com" row "Regrade" column of "attempts" table should contain "Done"
|
|
|
141 |
And "Student OneReview attempt" row "Q. 1/50.00Sort by Q. 1/50.00 Ascending" column of "attempts" table should contain "50.00/0.00"
|
|
|
142 |
And "Incorrect" "icon" should appear before "50.00/0.00" "text"
|
|
|
143 |
|
|
|
144 |
Scenario: Regrade all attempts works against quiz selected latest question version
|
|
|
145 |
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
|
|
146 |
And I navigate to "Results" in current page administration
|
|
|
147 |
And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
|
|
|
148 |
And I click on "Delete selected attempts" "button"
|
|
|
149 |
And I click on "Yes" "button"
|
|
|
150 |
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
|
|
151 |
And I should see "(latest)" in the "TF" "list_item"
|
|
|
152 |
# Create multiple question versions.
|
|
|
153 |
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
|
|
154 |
And I choose "Edit question" action for "TF" in the question bank
|
|
|
155 |
And I set the field "Correct answer" to "True"
|
|
|
156 |
And I press "id_submitbutton"
|
|
|
157 |
And I choose "Edit question" action for "TF" in the question bank
|
|
|
158 |
And I set the field "Question name" to "New version of TF"
|
|
|
159 |
And I set the field "Correct answer" to "False"
|
|
|
160 |
And I press "id_submitbutton"
|
|
|
161 |
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
|
|
162 |
And I should see "(latest)" in the "TF" "list_item"
|
|
|
163 |
And I click on "version" "select" in the "TF" "list_item"
|
|
|
164 |
And I should see "v1"
|
|
|
165 |
And I should see "v2"
|
|
|
166 |
And I should see "v3 (latest)"
|
|
|
167 |
# Set version that is going to be attempted to an older one.
|
|
|
168 |
And I set the field "version" in the "TF" "list_item" to "v1"
|
|
|
169 |
And user "student3" has attempted "Quiz for testing regrading" with responses:
|
|
|
170 |
| slot | response |
|
|
|
171 |
| 1 | True |
|
|
|
172 |
| 2 | toad |
|
|
|
173 |
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
|
|
174 |
And I set the field "version" in the "TF" "list_item" to "Always latest"
|
|
|
175 |
And I navigate to "Results" in current page administration
|
|
|
176 |
And I press "Regrade all"
|
|
|
177 |
And I should see "Finished regrading (1/1)"
|
|
|
178 |
And I should see "Regrade completed"
|
|
|
179 |
And I press "Continue"
|
|
|
180 |
Then "student3@example.com" row "Q. 1/50.00Sort by Q. 1/50.00 Ascending" column of "attempts" table should contain "50.00/0.00"
|
|
|
181 |
And "Incorrect" "icon" should appear before "50.00/0.00" "text"
|
|
|
182 |
|
|
|
183 |
Scenario: Regrade attempts should always regrade against latest random question version
|
|
|
184 |
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
|
|
185 |
And I navigate to "Results" in current page administration
|
|
|
186 |
And I click on "mod-quiz-report-overview-report-selectall-attempts" "checkbox"
|
|
|
187 |
And I click on "Delete selected attempts" "button"
|
|
|
188 |
And I click on "Yes" "button"
|
|
|
189 |
# Create multiple question versions.
|
|
|
190 |
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page
|
|
|
191 |
And I choose "Delete" action for "SA" in the question bank
|
|
|
192 |
And I press "Delete"
|
|
|
193 |
And I am on the "Quiz for testing regrading" "mod_quiz > edit" page
|
|
|
194 |
And I click on "Delete" "link" in the "TF" "list_item"
|
|
|
195 |
And I click on "Yes" "button" in the "Confirm" "dialogue"
|
|
|
196 |
And I click on "Delete" "link" in the "SA" "list_item"
|
|
|
197 |
And I click on "Yes" "button" in the "Confirm" "dialogue"
|
|
|
198 |
And I click on "Add" "link"
|
|
|
199 |
And I follow "a random question"
|
|
|
200 |
And I press "Add random question"
|
|
|
201 |
And I am on the "Quiz for testing regrading" "quiz activity" page logged in as student3
|
|
|
202 |
And I click on "Attempt quiz" "button"
|
|
|
203 |
And I should see "The answer is true."
|
|
|
204 |
And I set the field "True" to "1"
|
|
|
205 |
And I click on "Finish attempt ..." "button"
|
|
|
206 |
And I press "Submit all and finish"
|
|
|
207 |
And I click on "Submit" "button" in the "Submit all your answers and finish?" "dialogue"
|
|
|
208 |
And I am on the "Quiz for testing regrading" "mod_quiz > question bank" page logged in as teacher
|
|
|
209 |
And I choose "Edit question" action for "TF" in the question bank
|
|
|
210 |
And I set the field "Correct answer" to "False"
|
|
|
211 |
And I press "id_submitbutton"
|
|
|
212 |
And I navigate to "Results" in current page administration
|
|
|
213 |
And "student3@example.com" row "Q. 1/100.00Sort by Q. 1/100.00 Ascending" column of "attempts" table should contain "100.00"
|
|
|
214 |
And "Correct" "icon" should be visible
|
|
|
215 |
And I press "Regrade all"
|
|
|
216 |
And I should see "Finished regrading (1/1)"
|
|
|
217 |
And I should see "Regrade completed"
|
|
|
218 |
And I press "Continue"
|
|
|
219 |
Then "student3@example.com" row "Q. 1/100.00Sort by Q. 1/100.00 Ascending" column of "attempts" table should contain "100.00/0.00"
|
|
|
220 |
And "Incorrect" "icon" should be visible
|