[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
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 log in as "teacher1" 28 And I follow "Course 1" 29 And I navigate to "Grades" node in "Course administration" 30 And I set the field "Grade report" to "Gradebook setup" 31 And I set the following settings for grade item "Test assignment four (extra)": 32 | Extra credit | 1 | 33 And I set the following settings for grade item "Test assignment five (extra)": 34 | Extra credit | 1 | 35 36 @javascript 37 Scenario: No weights are overridden and student has all grades present (before the fix 20150619) 38 When I navigate to "Grades" node in "Course administration" 39 And I turn editing mode on 40 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 41 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 42 And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three" 43 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 44 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 45 And I press "Save changes" 46 And I set the field "Grade report" to "User report" 47 And I set the field "Select all or one user" to "Student 1" 48 Then the following should exist in the "user-grade" table: 49 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 50 | Test assignment one | 28.57 % | 80.00 | 0–100 | 80.00 % | 22.86 % | 51 | Test assignment two | 14.29 % | 30.00 | 0–50 | 60.00 % | 8.57 % | 52 | Test assignment three | 57.14 % | 150.00 | 0–200 | 75.00 % | 42.86 % | 53 | Test assignment four (extra) | 5.71 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 2.86 % | 54 | Test assignment five (extra) | 2.86 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 2.29 % | 55 | Course total | - | 278.00 | 0–350 | 79.43 % | - | 56 And I log out 57 58 @javascript 59 Scenario: No weights are overridden, student has some grades present (before the fix 20150619) 60 When I navigate to "Grades" node in "Course administration" 61 And I turn editing mode on 62 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 63 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 64 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 65 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 66 And I press "Save changes" 67 And I set the field "Grade report" to "User report" 68 And I set the field "Select all or one user" to "Student 1" 69 Then the following should exist in the "user-grade" table: 70 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 71 | Test assignment one | 66.67 % | 80.00 | 0–100 | 80.00 % | 53.33 % | 72 | Test assignment two | 33.33 % | 30.00 | 0–50 | 60.00 % | 20.00 % | 73 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 74 | Test assignment four (extra) | 13.33 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 6.67 % | 75 | Test assignment five (extra) | 6.67 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 5.33 % | 76 | Course total | - | 128.00 | 0–150 | 85.33 % | - | 77 And I log out 78 79 @javascript 80 Scenario: No weights are overridden, student has none grades present except for extra credit (before the fix 20150619) 81 When I navigate to "Grades" node in "Course administration" 82 And I turn editing mode on 83 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 84 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 85 And I press "Save changes" 86 And I set the field "Grade report" to "User report" 87 And I set the field "Select all or one user" to "Student 1" 88 Then the following should exist in the "user-grade" table: 89 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 90 | Test assignment one | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % | 91 | Test assignment two | 0.00 %( Empty ) | - | 0–50 | - | 0.00 % | 92 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 93 | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 0.00 % | 94 | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 0.00 % | 95 | Course total | - | 0.00 | 0–0 | | - | 96 And I log out 97 98 @javascript 99 Scenario: Make sure there are no errors when all items are marked as extra credit (before the fix 20150619) 100 And I set the following settings for grade item "Test assignment one": 101 | Extra credit | 1 | 102 And I set the following settings for grade item "Test assignment two": 103 | Extra credit | 1 | 104 And I set the following settings for grade item "Test assignment three": 105 | Extra credit | 1 | 106 When I navigate to "Grades" node in "Course administration" 107 And I turn editing mode on 108 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 109 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 110 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 111 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 112 And I press "Save changes" 113 And I set the field "Grade report" to "User report" 114 And I set the field "Select all or one user" to "Student 1" 115 Then the following should exist in the "user-grade" table: 116 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 117 | Test assignment one | 0.00 %( Extra credit ) | 80.00 | 0–100 | 80.00 % | 0.00 % | 118 | Test assignment two | 0.00 %( Extra credit ) | 30.00 | 0–50 | 60.00 % | 0.00 % | 119 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 120 | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 0.00 % | 121 | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 0.00 % | 122 | Course total | - | 0.0 | 0–0 | | - | 123 And I log out 124 125 @javascript 126 Scenario: Weights are overridden and student has all grades present (before the fix 20150619) 127 When I set the field "Override weight of Test assignment one" to "1" 128 And I set the field "Weight of Test assignment one" to "50" 129 And I press "Save changes" 130 When I navigate to "Grades" node in "Course administration" 131 And I turn editing mode on 132 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 133 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 134 And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three" 135 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 136 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 137 And I press "Save changes" 138 And I set the field "Grade report" to "User report" 139 And I set the field "Select all or one user" to "Student 1" 140 Then the following should exist in the "user-grade" table: 141 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 142 | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 40.00 % | 143 | Test assignment two | 10.00 % | 30.00 | 0–50 | 60.00 % | 6.00 % | 144 | Test assignment three | 40.00 % | 150.00 | 0–200 | 75.00 % | 30.00 % | 145 | Test assignment four (extra) | 4.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 2.00 % | 146 | Test assignment five (extra) | 2.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 1.60 % | 147 | Course total | - | 278.60 | 0–350 | 79.60 % | - | 148 # 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") 149 And I log out 150 151 @javascript 152 Scenario: Weights are overridden and student has some grades present (before the fix 20150619) 153 When I set the field "Override weight of Test assignment one" to "1" 154 And I set the field "Weight of Test assignment one" to "50" 155 And I press "Save changes" 156 When I navigate to "Grades" node in "Course administration" 157 And I turn editing mode on 158 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 159 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 160 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 161 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 162 And I press "Save changes" 163 And I set the field "Grade report" to "User report" 164 And I set the field "Select all or one user" to "Student 1" 165 Then the following should exist in the "user-grade" table: 166 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 167 | Test assignment one | 83.33 % | 80.00 | 0–100 | 80.00 % | 66.67 % | 168 | Test assignment two | 16.67 % | 30.00 | 0–50 | 60.00 % | 10.00 % | 169 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 170 | Test assignment four (extra) | 6.67 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 3.33 % | 171 | Test assignment five (extra) | 3.33 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 2.67 % | 172 | Course total | - | 124.00 | 0–150 | 82.67 % | - | 173 # 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") 174 And I log out 175 176 @javascript 177 Scenario: Weights are overridden, student has none grades present except for extra credit (before the fix 20150619) 178 When I set the field "Override weight of Test assignment one" to "1" 179 And I set the field "Weight of Test assignment one" to "50" 180 And I press "Save changes" 181 When I navigate to "Grades" node in "Course administration" 182 And I turn editing mode on 183 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 184 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 185 And I press "Save changes" 186 And I set the field "Grade report" to "User report" 187 And I set the field "Select all or one user" to "Student 1" 188 Then the following should exist in the "user-grade" table: 189 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 190 | Test assignment one | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % | 191 | Test assignment two | 0.00 %( Empty ) | - | 0–50 | - | 0.00 % | 192 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 193 | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 0.00 % | 194 | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 0.00 % | 195 | Course total | - | 0.00 | 0–0 | | - | 196 And I log out 197 198 @javascript 199 Scenario: Weights are overridden, including extra credit, and student has all grades present (before the fix 20150619) 200 When I set the field "Override weight of Test assignment one" to "1" 201 And I set the field "Weight of Test assignment one" to "50" 202 And I set the field "Override weight of Test assignment four (extra)" to "1" 203 And I set the field "Weight of Test assignment four (extra)" to "10" 204 And I press "Save changes" 205 When I navigate to "Grades" node in "Course administration" 206 And I turn editing mode on 207 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 208 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 209 And I give the grade "150.00" to the user "Student 1" for the grade item "Test assignment three" 210 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 211 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 212 And I press "Save changes" 213 And I set the field "Grade report" to "User report" 214 And I set the field "Select all or one user" to "Student 1" 215 Then the following should exist in the "user-grade" table: 216 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 217 | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 40.00 % | 218 | Test assignment two | 8.70 % | 30.00 | 0–50 | 60.00 % | 5.22 % | 219 | Test assignment three | 34.78 % | 150.00 | 0–200 | 75.00 % | 26.09 % | 220 | Test assignment four (extra) | 10.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 5.00 % | 221 | Test assignment five (extra) | 1.74 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 1.39 % | 222 | Course total | - | 271.93 | 0–350 | 77.70 % | - | 223 # Which is absolutely terrible because weights of normal items do not add up to 100% 224 And I log out 225 226 @javascript 227 Scenario: Weights are overridden, including extra credit, and student has some grades present (before the fix 20150619) 228 When I set the field "Override weight of Test assignment one" to "1" 229 And I set the field "Weight of Test assignment one" to "50" 230 And I set the field "Override weight of Test assignment four (extra)" to "1" 231 And I set the field "Weight of Test assignment four (extra)" to "10" 232 And I press "Save changes" 233 When I navigate to "Grades" node in "Course administration" 234 And I turn editing mode on 235 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" 236 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" 237 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 238 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 239 And I press "Save changes" 240 And I set the field "Grade report" to "User report" 241 And I set the field "Select all or one user" to "Student 1" 242 Then the following should exist in the "user-grade" table: 243 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 244 | Test assignment one | 83.33 % | 80.00 | 0–100 | 80.00 % | 66.67 % | 245 | Test assignment two | 0.00 % | 30.00 | 0–50 | 60.00 % | 0.00 % | 246 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 247 | Test assignment four (extra) | 16.67 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 8.33 % | 248 | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 0.00 % | 249 | Course total | - | 112.50 | 0–150 | 75.00 % | - | 250 # 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. 251 And I log out 252 253 @javascript 254 Scenario: Weights are overridden, including extra credit, student has none grades present except for extra credit (before the fix 20150619) 255 When I set the field "Override weight of Test assignment one" to "1" 256 And I set the field "Weight of Test assignment one" to "50" 257 And I set the field "Override weight of Test assignment four (extra)" to "1" 258 And I set the field "Weight of Test assignment four (extra)" to "10" 259 And I press "Save changes" 260 When I navigate to "Grades" node in "Course administration" 261 And I turn editing mode on 262 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" 263 And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" 264 And I press "Save changes" 265 And I set the field "Grade report" to "User report" 266 And I set the field "Select all or one user" to "Student 1" 267 Then the following should exist in the "user-grade" table: 268 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | 269 | Test assignment one | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % | 270 | Test assignment two | 0.00 %( Empty ) | - | 0–50 | - | 0.00 % | 271 | Test assignment three | 0.00 %( Empty ) | - | 0–200 | - | 0.00 % | 272 | Test assignment four (extra) | 0.00 %( Extra credit ) | 10.00 | 0–20 | 50.00 % | 0.00 % | 273 | Test assignment five (extra) | 0.00 %( Extra credit ) | 8.00 | 0–10 | 80.00 % | 0.00 % | 274 | Course total | - | 0.00 | 0–0 | | - | 275 And I log out
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |