Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_grades
2
Feature: Gradebook calculations for extra credit items before the fix 20150619
3
  In order to make sure the grades are not changed after upgrade
4
  As a teacher
5
  I need to be able to freeze gradebook calculations
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | category | groupmode |
10
      | Course 1 | C1 | 0 | 1 |
11
    And gradebook calculations for the course "C1" are frozen at version "20150619"
12
    And the following "users" exist:
13
      | username | firstname | lastname | email                | idnumber |
14
      | teacher1 | Teacher   | 1        | teacher1@example.com | t1       |
15
      | student1 | Student   | 1        | student1@example.com | s1       |
16
    And the following "course enrolments" exist:
17
      | user | course | role |
18
      | teacher1 | C1 | editingteacher |
19
      | student1 | C1 | student |
20
    And the following "activities" exist:
21
      | activity | course | idnumber | name                         | intro | grade |
22
      | assign   | C1     | a1       | Test assignment one          | x     | 100   |
23
      | assign   | C1     | a2       | Test assignment two          | x     | 50    |
24
      | assign   | C1     | a3       | Test assignment three        | x     | 200   |
25
      | assign   | C1     | a4       | Test assignment four (extra) | x     | 20    |
26
      | assign   | C1     | a5       | Test assignment five (extra) | x     | 10    |
27
    And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
28
    And I set the following settings for grade item "Test assignment four (extra)" of type "gradeitem" on "setup" page:
29
      | Extra credit | 1 |
30
    And I set the following settings for grade item "Test assignment five (extra)" of type "gradeitem" on "setup" page:
31
      | Extra credit | 1 |
32
 
33
  @javascript
34
  Scenario: No weights are overridden and student has all grades present (before the fix 20150619)
35
    When I navigate to "View > Grader report" in the course gradebook
36
    And I turn editing mode on
37
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
38
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
39
    And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three"
40
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
41
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
42
    And I press "Save changes"
43
    And I navigate to "View > User report" in the course gradebook
44
    And I click on "Student 1" in the "user" search widget
45
    Then the following should exist in the "user-grade" table:
46
      | Grade item                   | Calculated weight      | Grade  | Range | Percentage | Contribution to course total |
47
      | Test assignment one          | 28.57 %                | 80.00  | 0–100 | 80.00 %    | 22.86 %                      |
48
      | Test assignment two          | 14.29 %                | 30.00  | 0–50  | 60.00 %    | 8.57 %                       |
49
      | Test assignment three        | 57.14 %                | 150.00 | 0–200 | 75.00 %    | 42.86 %                      |
50
      | Test assignment four (extra) | 5.71 %( Extra credit ) | 10.00  | 0–20  | 50.00 %    | 2.86 %                       |
51
      | Test assignment five (extra) | 2.86 %( Extra credit ) | 8.00   | 0–10  | 80.00 %    | 2.29 %                       |
52
      | Course total                 | -                      | 278.00 | 0–350 | 79.43 %    | -                            |
53
    And I log out
54
 
55
  @javascript
56
  Scenario: No weights are overridden, student has some grades present (before the fix 20150619)
57
    When I navigate to "View > Grader report" in the course gradebook
58
    And I turn editing mode on
59
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
60
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
61
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
62
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
63
    And I press "Save changes"
64
    And I navigate to "View > User report" in the course gradebook
65
    And I click on "Student 1" in the "user" search widget
66
    Then the following should exist in the "user-grade" table:
67
      | Grade item                   | Calculated weight       | Grade  | Range | Percentage | Contribution to course total |
68
      | Test assignment one          | 66.67 %                 | 80.00  | 0–100 | 80.00 %    | 53.33 %                      |
69
      | Test assignment two          | 33.33 %                 | 30.00  | 0–50  | 60.00 %    | 20.00 %                      |
70
      | Test assignment three        | 0.00 %( Empty )         | -      | 0–200 | -          | 0.00 %                       |
71
      | Test assignment four (extra) | 13.33 %( Extra credit ) | 10.00  | 0–20  | 50.00 %    | 6.67 %                       |
72
      | Test assignment five (extra) | 6.67 %( Extra credit )  | 8.00   | 0–10  | 80.00 %    | 5.33 %                       |
73
      | Course total                 | -                       | 128.00 | 0–150 | 85.33 %    | -                            |
74
    And I log out
75
 
76
  @javascript
77
  Scenario: No weights are overridden, student has none grades present except for extra credit (before the fix 20150619)
78
    When I navigate to "View > Grader report" in the course gradebook
79
    And I turn editing mode on
80
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
81
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
82
    And I press "Save changes"
83
    And I navigate to "View > User report" in the course gradebook
84
    And I click on "Student 1" in the "user" search widget
85
    Then the following should exist in the "user-grade" table:
86
      | Grade item                   | Calculated weight      | Grade | Range | Percentage | Contribution to course total |
87
      | Test assignment one          | 0.00 %( Empty )        | -     | 0–100 | -          | 0.00 %                       |
88
      | Test assignment two          | 0.00 %( Empty )        | -     | 0–50  | -          | 0.00 %                       |
89
      | Test assignment three        | 0.00 %( Empty )        | -     | 0–200 | -          | 0.00 %                       |
90
      | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20  | 50.00 %    | 0.00 %                       |
91
      | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00  | 0–10  | 80.00 %    | 0.00 %                       |
92
      | Course total                 | -                      | 0.00  | 0–0   |            | -                            |
93
    And I log out
94
 
95
  @javascript
96
  Scenario: Make sure there are no errors when all items are marked as extra credit (before the fix 20150619)
97
    And I set the following settings for grade item "Test assignment one" of type "gradeitem" on "setup" page:
98
      | Extra credit | 1 |
99
    And I set the following settings for grade item "Test assignment two" of type "gradeitem" on "setup" page:
100
      | Extra credit | 1 |
101
    And I set the following settings for grade item "Test assignment three" of type "gradeitem" on "setup" page:
102
      | Extra credit | 1 |
103
    When I navigate to "View > Grader report" in the course gradebook
104
    And I turn editing mode on
105
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
106
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
107
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
108
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
109
    And I press "Save changes"
110
    And I navigate to "View > User report" in the course gradebook
111
    And I click on "Student 1" in the "user" search widget
112
    Then the following should exist in the "user-grade" table:
113
      | Grade item                   | Calculated weight      | Grade | Range | Percentage | Contribution to course total |
114
      | Test assignment one          | 0.00 %( Extra credit ) | 80.00 | 0–100 | 80.00 %    | 0.00 %                       |
115
      | Test assignment two          | 0.00 %( Extra credit ) | 30.00 | 0–50  | 60.00 %    | 0.00 %                       |
116
      | Test assignment three        | 0.00 %( Empty )        | -     | 0–200 | -          | 0.00 %                       |
117
      | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20  | 50.00 %    | 0.00 %                       |
118
      | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00  | 0–10  | 80.00 %    | 0.00 %                       |
119
      | Course total                 | -                      | 0.0   | 0–0   |            | -                            |
120
    And I log out
121
 
122
  @javascript
123
  Scenario: Weights are overridden and student has all grades present (before the fix 20150619)
124
    When I set the field "Override weight of Test assignment one" to "1"
125
    And I set the field "Weight of Test assignment one" to "50"
126
    And I press "Save changes"
127
    When I navigate to "View > Grader report" in the course gradebook
128
    And I turn editing mode on
129
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
130
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
131
    And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three"
132
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
133
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
134
    And I press "Save changes"
135
    And I navigate to "View > User report" in the course gradebook
136
    And I click on "Student 1" in the "user" search widget
137
    Then the following should exist in the "user-grade" table:
138
      | Grade item                   | Calculated weight      | Grade  | Range | Percentage | Contribution to course total |
139
      | Test assignment one          | 50.00 %                | 80.00  | 0–100 | 80.00 %    | 40.00 %                      |
140
      | Test assignment two          | 10.00 %                | 30.00  | 0–50  | 60.00 %    | 6.00 %                       |
141
      | Test assignment three        | 40.00 %                | 150.00 | 0–200 | 75.00 %    | 30.00 %                      |
142
      | Test assignment four (extra) | 4.00 %( Extra credit ) | 10.00  | 0–20  | 50.00 %    | 2.00 %                       |
143
      | Test assignment five (extra) | 2.00 %( Extra credit ) | 8.00   | 0–10  | 80.00 %    | 1.60 %                       |
144
      | Course total                 | -                      | 278.60 | 0–350 | 79.60 %    | -                            |
145
    # Contributions of extra credit "four" should be 20/350=5.71% and "five" 10/350=2.86% (350 is max grade for the course, 20 and 10 are max grades of "four" and "five")
146
    And I log out
147
 
148
  @javascript
149
  Scenario: Weights are overridden and student has some grades present (before the fix 20150619)
150
    When I set the field "Override weight of Test assignment one" to "1"
151
    And I set the field "Weight of Test assignment one" to "50"
152
    And I press "Save changes"
153
    When I navigate to "View > Grader report" in the course gradebook
154
    And I turn editing mode on
155
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
156
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
157
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
158
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
159
    And I press "Save changes"
160
    And I navigate to "View > User report" in the course gradebook
161
    And I click on "Student 1" in the "user" search widget
162
    Then the following should exist in the "user-grade" table:
163
      | Grade item                   | Calculated weight       | Grade  | Range | Percentage | Contribution to course total |
164
      | Test assignment one          | 83.33 %                 | 80.00  | 0–100 | 80.00 %    | 66.67 %                      |
165
      | Test assignment two          | 16.67 %                 | 30.00  | 0–50  | 60.00 %    | 10.00 %                      |
166
      | Test assignment three        | 0.00 %( Empty )         | -      | 0–200 | -          | 0.00 %                       |
167
      | Test assignment four (extra) | 6.67 %( Extra credit )  | 10.00  | 0–20  | 50.00 %    | 3.33 %                       |
168
      | Test assignment five (extra) | 3.33 %( Extra credit )  | 8.00   | 0–10  | 80.00 %    | 2.67 %                       |
169
      | Course total                 | -                       | 124.00 | 0–150 | 82.67 %    | -                            |
170
    # Contributions of extra credit "four" should be 20/150=13.33% and "five" 10/150=6.67% (150 is max grade for the course, 20 and 10 are max grades of "four" and "five")
171
    And I log out
172
 
173
  @javascript
174
  Scenario: Weights are overridden, student has none grades present except for extra credit (before the fix 20150619)
175
    When I set the field "Override weight of Test assignment one" to "1"
176
    And I set the field "Weight of Test assignment one" to "50"
177
    And I press "Save changes"
178
    When I navigate to "View > Grader report" in the course gradebook
179
    And I turn editing mode on
180
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
181
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
182
    And I press "Save changes"
183
    And I navigate to "View > User report" in the course gradebook
184
    And I click on "Student 1" in the "user" search widget
185
    Then the following should exist in the "user-grade" table:
186
      | Grade item                   | Calculated weight      | Grade | Range | Percentage | Contribution to course total |
187
      | Test assignment one          | 0.00 %( Empty )        | -     | 0–100 | -          | 0.00 %                       |
188
      | Test assignment two          | 0.00 %( Empty )        | -     | 0–50  | -          | 0.00 %                       |
189
      | Test assignment three        | 0.00 %( Empty )        | -     | 0–200 | -          | 0.00 %                       |
190
      | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20  | 50.00 %    | 0.00 %                       |
191
      | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00  | 0–10  | 80.00 %    | 0.00 %                       |
192
      | Course total                 | -                      | 0.00  | 0–0   |            | -                            |
193
    And I log out
194
 
195
  @javascript
196
  Scenario: Weights are overridden, including extra credit, and student has all grades present (before the fix 20150619)
197
    When I set the field "Override weight of Test assignment one" to "1"
198
    And I set the field "Weight of Test assignment one" to "50"
199
    And I set the field "Override weight of Test assignment four (extra)" to "1"
200
    And I set the field "Weight of Test assignment four (extra)" to "10"
201
    And I press "Save changes"
202
    When I navigate to "View > Grader report" in the course gradebook
203
    And I turn editing mode on
204
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
205
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
206
    And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three"
207
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
208
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
209
    And I press "Save changes"
210
    And I navigate to "View > User report" in the course gradebook
211
    And I click on "Student 1" in the "user" search widget
212
    Then the following should exist in the "user-grade" table:
213
      | Grade item                   | Calculated weight       | Grade  | Range | Percentage | Contribution to course total |
214
      | Test assignment one          | 50.00 %                 | 80.00  | 0–100 | 80.00 %    | 40.00 %                      |
215
      | Test assignment two          | 8.70 %                  | 30.00  | 0–50  | 60.00 %    | 5.22 %                       |
216
      | Test assignment three        | 34.78 %                 | 150.00 | 0–200 | 75.00 %    | 26.09 %                      |
217
      | Test assignment four (extra) | 10.00 %( Extra credit ) | 10.00  | 0–20  | 50.00 %    | 5.00 %                       |
218
      | Test assignment five (extra) | 1.74 %( Extra credit )  | 8.00   | 0–10  | 80.00 %    | 1.39 %                       |
219
      | Course total                 | -                       | 271.93 | 0–350 | 77.70 %    | -                            |
220
    # Which is absolutely terrible because weights of normal items do not add up to 100%
221
    And I log out
222
 
223
  @javascript
224
  Scenario: Weights are overridden, including extra credit, and student has some grades present (before the fix 20150619)
225
    When I set the field "Override weight of Test assignment one" to "1"
226
    And I set the field "Weight of Test assignment one" to "50"
227
    And I set the field "Override weight of Test assignment four (extra)" to "1"
228
    And I set the field "Weight of Test assignment four (extra)" to "10"
229
    And I press "Save changes"
230
    And I navigate to "View > Grader report" in the course gradebook
231
    And I turn editing mode on
232
    And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
233
    And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two"
234
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
235
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
236
    And I press "Save changes"
237
    And I navigate to "View > User report" in the course gradebook
238
    And I click on "Student 1" in the "user" search widget
239
    Then the following should exist in the "user-grade" table:
240
      | Grade item                   | Calculated weight       | Grade  | Range | Percentage | Contribution to course total |
241
      | Test assignment one          | 83.33 %                 | 80.00  | 0–100 | 80.00 %    | 66.67 %                      |
242
      | Test assignment two          | 0.00 %                  | 30.00  | 0–50  | 60.00 %    | 0.00 %                       |
243
      | Test assignment three        | 0.00 %( Empty )         | -      | 0–200 | -          | 0.00 %                       |
244
      | Test assignment four (extra) | 16.67 %( Extra credit ) | 10.00  | 0–20  | 50.00 %    | 8.33 %                       |
245
      | Test assignment five (extra) | 0.00 %( Extra credit )  | 8.00   | 0–10  | 80.00 %    | 0.00 %                       |
246
      | Course total                 | -                       | 112.50 | 0–150 | 75.00 %    | -                            |
247
    # This is just ridiculous, the grades for "two" and "five" are 0 without any reason, and sum weight of normal items is not 100% again.
248
    And I log out
249
 
250
  @javascript
251
  Scenario: Weights are overridden, including extra credit, student has none grades present except for extra credit (before the fix 20150619)
252
    When I set the field "Override weight of Test assignment one" to "1"
253
    And I set the field "Weight of Test assignment one" to "50"
254
    And I set the field "Override weight of Test assignment four (extra)" to "1"
255
    And I set the field "Weight of Test assignment four (extra)" to "10"
256
    And I press "Save changes"
257
    When I navigate to "View > Grader report" in the course gradebook
258
    And I turn editing mode on
259
    And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)"
260
    And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)"
261
    And I press "Save changes"
262
    And I navigate to "View > User report" in the course gradebook
263
    And I click on "Student 1" in the "user" search widget
264
    Then the following should exist in the "user-grade" table:
265
      | Grade item                   | Calculated weight      | Grade | Range | Percentage | Contribution to course total |
266
      | Test assignment one          | 0.00 %( Empty )        | -     | 0–100 | -          | 0.00 %                       |
267
      | Test assignment two          | 0.00 %( Empty )        | -     | 0–50  | -          | 0.00 %                       |
268
      | Test assignment three        | 0.00 %( Empty )        | -     | 0–200 | -          | 0.00 %                       |
269
      | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20  | 50.00 %    | 0.00 %                       |
270
      | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00  | 0–10  | 80.00 %    | 0.00 %                       |
271
      | Course total                 | -                      | 0.00  | 0–0   |            | -                            |
272
    And I log out