1 |
efrain |
1 |
@core @core_grades
|
|
|
2 |
Feature: We can use natural aggregation and weights will be normalised to a total of one hundred
|
|
|
3 |
In order to override weights
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add assessments to the gradebook.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email | idnumber |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com | s1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "grade categories" exist:
|
|
|
20 |
| fullname | course |
|
|
|
21 |
| Sub category 1 | C1 |
|
|
|
22 |
And the following "activities" exist:
|
|
|
23 |
| activity | course | idnumber | name | intro | grade |
|
|
|
24 |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
|
|
|
25 |
| assign | C1 | a2 | Test assignment two | Submit something! | 100 |
|
|
|
26 |
| assign | C1 | a3 | Test assignment three | Submit something! | 150 |
|
|
|
27 |
| assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
|
|
|
28 |
And the following "activities" exist:
|
|
|
29 |
| activity | course | idnumber | name | intro | gradecategory | grade |
|
|
|
30 |
| assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 20 |
|
|
|
31 |
| assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 10 |
|
|
|
32 |
| assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 |
|
|
|
33 |
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
|
|
|
34 |
|
|
|
35 |
@javascript
|
|
|
36 |
Scenario: Setting all weights in a category to exactly one hundred in total.
|
|
|
37 |
And the field "Weight of Test assignment five" matches value "44.444"
|
|
|
38 |
And the field "Weight of Test assignment six" matches value "22.222"
|
|
|
39 |
And the field "Weight of Test assignment seven" matches value "33.333"
|
|
|
40 |
When I set the field "Override weight of Test assignment five" to "1"
|
|
|
41 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
42 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
43 |
And I set the field "Weight of Test assignment five" to "30"
|
|
|
44 |
And I set the field "Weight of Test assignment six" to "50"
|
|
|
45 |
And I set the field "Weight of Test assignment seven" to "20"
|
|
|
46 |
And I press "Save changes"
|
|
|
47 |
Then I should not see "Your weights have been adjusted to total 100."
|
|
|
48 |
And the field "Weight of Test assignment five" matches value "30.0"
|
|
|
49 |
And the field "Weight of Test assignment six" matches value "50.0"
|
|
|
50 |
And the field "Weight of Test assignment seven" matches value "20.0"
|
|
|
51 |
|
|
|
52 |
@javascript
|
|
|
53 |
Scenario: Setting all weights in a category to less than one hundred is prevented.
|
|
|
54 |
When I set the field "Override weight of Test assignment five" to "1"
|
|
|
55 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
56 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
57 |
And I set the field "Weight of Test assignment five" to "1"
|
|
|
58 |
And I set the field "Weight of Test assignment six" to "1"
|
|
|
59 |
And I set the field "Weight of Test assignment seven" to "2"
|
|
|
60 |
Then I should see "Weight total is less than 100%." in the "Test assignment five" "table_row"
|
|
|
61 |
And I should see "Weight total is less than 100%." in the "Test assignment six" "table_row"
|
|
|
62 |
And I should see "Weight total is less than 100%." in the "Test assignment seven" "table_row"
|
|
|
63 |
And I start watching to see if a new page loads
|
|
|
64 |
And I press "Save changes"
|
|
|
65 |
And a new page should not have loaded since I started watching
|
|
|
66 |
|
|
|
67 |
@javascript
|
|
|
68 |
Scenario: Set one of the grade item weights to a figure over one hundred is prevented.
|
|
|
69 |
When I set the field "Override weight of Test assignment five" to "1"
|
|
|
70 |
And I set the field "Weight of Test assignment five" to "120"
|
|
|
71 |
Then I should see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
72 |
And the field "Weight of Test assignment five" matches value "120.0"
|
|
|
73 |
And the field "Weight of Test assignment six" matches value "0.0"
|
|
|
74 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
75 |
And I start watching to see if a new page loads
|
|
|
76 |
And I press "Save changes"
|
|
|
77 |
And a new page should not have loaded since I started watching
|
|
|
78 |
|
|
|
79 |
@javascript
|
|
|
80 |
Scenario: Setting several but not all grade item weights to over one hundred each is prevented.
|
|
|
81 |
When I set the field "Override weight of Test assignment five" to "1"
|
|
|
82 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
83 |
And I set the field "Weight of Test assignment five" to "150"
|
|
|
84 |
And I set the field "Weight of Test assignment six" to "150"
|
|
|
85 |
Then I should see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
86 |
And I should see "Weight total exceeds 100%." in the "Test assignment six" "table_row"
|
|
|
87 |
And the field "Weight of Test assignment five" matches value "150.0"
|
|
|
88 |
And the field "Weight of Test assignment six" matches value "150.0"
|
|
|
89 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
90 |
And I start watching to see if a new page loads
|
|
|
91 |
And I press "Save changes"
|
|
|
92 |
And a new page should not have loaded since I started watching
|
|
|
93 |
|
|
|
94 |
@javascript
|
|
|
95 |
Scenario: Grade items weights are not normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set respectful to number of items.
|
|
|
96 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
97 |
| Extra credit | 1 |
|
|
|
98 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
99 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
100 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
101 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
102 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
103 |
And I set the field "Weight of Test assignment five" to "60"
|
|
|
104 |
And I set the field "Weight of Test assignment six" to "40"
|
|
|
105 |
And I press "Save changes"
|
|
|
106 |
Then I should not see "Your weights have been adjusted to total 100."
|
|
|
107 |
And the field "Weight of Test assignment five" matches value "60.000"
|
|
|
108 |
And the field "Weight of Test assignment six" matches value "40.000"
|
|
|
109 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
110 |
And I reset weights for grade category "Sub category 1"
|
|
|
111 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
112 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
113 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
114 |
|
|
|
115 |
@javascript
|
|
|
116 |
Scenario: Setting grade items weights is prevented when all grade item weights are overridden (sum over 100). Extra credit is set respectful to number of items.
|
|
|
117 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
118 |
| Extra credit | 1 |
|
|
|
119 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
120 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
121 |
And I set the field "Weight of Test assignment five" to "60"
|
|
|
122 |
And I set the field "Weight of Test assignment six" to "50"
|
|
|
123 |
Then I should see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
124 |
And I should see "Weight total exceeds 100%." in the "Test assignment six" "table_row"
|
|
|
125 |
And the field "Weight of Test assignment five" matches value "60.0"
|
|
|
126 |
And the field "Weight of Test assignment six" matches value "50.0"
|
|
|
127 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
128 |
And I start watching to see if a new page loads
|
|
|
129 |
And I press "Save changes"
|
|
|
130 |
And a new page should not have loaded since I started watching
|
|
|
131 |
And I reset weights for grade category "Sub category 1"
|
|
|
132 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
133 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
134 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
135 |
|
|
|
136 |
@javascript
|
|
|
137 |
Scenario: Setting grade items weights is prevented when all grade item weights are overridden (sum under 100). Extra credit is set respectful to number of items.
|
|
|
138 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
139 |
| Extra credit | 1 |
|
|
|
140 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
141 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
142 |
And I set the field "Weight of Test assignment five" to "40"
|
|
|
143 |
And I set the field "Weight of Test assignment six" to "30"
|
|
|
144 |
Then I should see "Weight total is less than 100%." in the "Test assignment five" "table_row"
|
|
|
145 |
And I should see "Weight total is less than 100%." in the "Test assignment six" "table_row"
|
|
|
146 |
And the field "Weight of Test assignment five" matches value "40.0"
|
|
|
147 |
And the field "Weight of Test assignment six" matches value "30.0"
|
|
|
148 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
149 |
And I start watching to see if a new page loads
|
|
|
150 |
And I press "Save changes"
|
|
|
151 |
And a new page should not have loaded since I started watching
|
|
|
152 |
And I reset weights for grade category "Sub category 1"
|
|
|
153 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
154 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
155 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
156 |
|
|
|
157 |
@javascript
|
|
|
158 |
Scenario: Grade items weights are normalised when not all grade item weights are overridden. Extra credit is set respectful to number of items.
|
|
|
159 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
160 |
| Extra credit | 1 |
|
|
|
161 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
162 |
And I set the field "Weight of Test assignment five" to "40"
|
|
|
163 |
And I press "Save changes"
|
|
|
164 |
Then I should see "Your weights have been adjusted to total 100."
|
|
|
165 |
And the field "Weight of Test assignment five" matches value "40.00"
|
|
|
166 |
And the field "Weight of Test assignment six" matches value "60.000"
|
|
|
167 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
168 |
And I reset weights for grade category "Sub category 1"
|
|
|
169 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
170 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
171 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
172 |
|
|
|
173 |
@javascript
|
|
|
174 |
Scenario: The extra credit grade item weight is overridden to a figure over one hundred and then the grade item is set to normal.
|
|
|
175 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
176 |
| Extra credit | 1 |
|
|
|
177 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
178 |
And I set the field "Weight of Test assignment seven" to "105"
|
|
|
179 |
And I press "Save changes"
|
|
|
180 |
Then I should not see "Your weights have been adjusted to total 100."
|
|
|
181 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
182 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
183 |
And the field "Weight of Test assignment seven" matches value "105.0"
|
|
|
184 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
185 |
| Extra credit | 0 |
|
|
|
186 |
And I should see "Your weights have been adjusted to total 100."
|
|
|
187 |
And the field "Weight of Test assignment five" matches value "0.0"
|
|
|
188 |
And the field "Weight of Test assignment six" matches value "0.0"
|
|
|
189 |
And the field "Weight of Test assignment seven" matches value "100.0"
|
|
|
190 |
|
|
|
191 |
@javascript
|
|
|
192 |
Scenario: The extra credit grade item weight is overridden to a figure over one hundred and then the grade category is reset.
|
|
|
193 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
194 |
| Extra credit | 1 |
|
|
|
195 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
196 |
And I set the field "Weight of Test assignment seven" to "105"
|
|
|
197 |
And I press "Save changes"
|
|
|
198 |
And I reset weights for grade category "Sub category 1"
|
|
|
199 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
200 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
201 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
202 |
|
|
|
203 |
@javascript
|
|
|
204 |
Scenario: Two out of three grade items weights are overridden and one is not. The overridden grade item weights total over one hundred.
|
|
|
205 |
Given I set the field "Override weight of Test assignment six" to "1"
|
|
|
206 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
207 |
And I set the field "Weight of Test assignment six" to "55"
|
|
|
208 |
And I set the field "Weight of Test assignment seven" to "65"
|
|
|
209 |
Then I should not see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
210 |
And I should see "Weight total exceeds 100%." in the "Test assignment six" "table_row"
|
|
|
211 |
And I should see "Weight total exceeds 100%." in the "Test assignment seven" "table_row"
|
|
|
212 |
And the field "Weight of Test assignment five" matches value "0.0"
|
|
|
213 |
And the field "Weight of Test assignment six" matches value "55.0"
|
|
|
214 |
And the field "Weight of Test assignment seven" matches value "65.0"
|
|
|
215 |
And I start watching to see if a new page loads
|
|
|
216 |
And I press "Save changes"
|
|
|
217 |
And a new page should not have loaded since I started watching
|
|
|
218 |
|
|
|
219 |
@javascript
|
|
|
220 |
Scenario: With one grade item set as extra credit, when I reset the weights for a category they return to the natural weights.
|
|
|
221 |
When I set the following settings for grade item "Test assignment five" of type "gradeitem" on "setup" page:
|
|
|
222 |
| Extra credit | 1 |
|
|
|
223 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
224 |
And I set the field "Override weight of Test assignment seven" to "1"
|
|
|
225 |
And I set the field "Weight of Test assignment six" to "55"
|
|
|
226 |
And I set the field "Weight of Test assignment seven" to "40"
|
|
|
227 |
And I press "Save changes"
|
|
|
228 |
And I reset weights for grade category "Sub category 1"
|
|
|
229 |
Then the field "Weight of Test assignment five" matches value "80.0"
|
|
|
230 |
And the field "Weight of Test assignment six" matches value "40.0"
|
|
|
231 |
And the field "Weight of Test assignment seven" matches value "60.0"
|
|
|
232 |
|
|
|
233 |
@javascript
|
|
|
234 |
Scenario: Overriding a grade item with a negative value results in the value being changed to zero.
|
|
|
235 |
When I set the field "Override weight of Test assignment five" to "1"
|
|
|
236 |
And I set the field "Weight of Test assignment five" to "-15"
|
|
|
237 |
Then the field "Weight of Test assignment five" matches value "0.0"
|
|
|
238 |
And the field "Weight of Test assignment six" matches value "40.0"
|
|
|
239 |
And the field "Weight of Test assignment seven" matches value "60.0"
|
|
|
240 |
And I press "Save changes"
|
|
|
241 |
Then the field "Weight of Test assignment five" matches value "0.0"
|
|
|
242 |
And the field "Weight of Test assignment six" matches value "40.0"
|
|
|
243 |
And the field "Weight of Test assignment seven" matches value "60.0"
|
|
|
244 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
245 |
And I set the field "Weight of Test assignment six" to "-25"
|
|
|
246 |
And the field "Weight of Test assignment six" matches value "0.0"
|
|
|
247 |
And the field "Weight of Test assignment seven" matches value "100.0"
|
|
|
248 |
And I reset weights for grade category "Sub category 1"
|
|
|
249 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
250 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
251 |
And I set the field "Weight of Test assignment five" to "-10"
|
|
|
252 |
And I set the field "Weight of Test assignment six" to "120"
|
|
|
253 |
And I should see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
254 |
And I should see "Weight total exceeds 100%." in the "Test assignment six" "table_row"
|
|
|
255 |
And the field "Weight of Test assignment five" matches value "0.0"
|
|
|
256 |
And the field "Weight of Test assignment six" matches value "120.0"
|
|
|
257 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
258 |
And I start watching to see if a new page loads
|
|
|
259 |
And I press "Save changes"
|
|
|
260 |
And a new page should not have loaded since I started watching
|