1 |
efrain |
1 |
@core @core_grades
|
|
|
2 |
Feature: Gradebook calculations for natural weights normalisation 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 "grade categories" exist:
|
|
|
21 |
| fullname | course |
|
|
|
22 |
| Sub category 1 | C1 |
|
|
|
23 |
And the following "activities" exist:
|
|
|
24 |
| activity | course | idnumber | name | intro | grade |
|
|
|
25 |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
|
|
|
26 |
| assign | C1 | a2 | Test assignment two | Submit something! | 100 |
|
|
|
27 |
| assign | C1 | a3 | Test assignment three | Submit something! | 150 |
|
|
|
28 |
| assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
|
|
|
29 |
And the following "activities" exist:
|
|
|
30 |
| activity | course | idnumber | name | intro | gradecategory | grade |
|
|
|
31 |
| assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 20 |
|
|
|
32 |
| assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 10 |
|
|
|
33 |
| assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 |
|
|
|
34 |
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
|
|
|
35 |
|
|
|
36 |
@javascript
|
|
|
37 |
Scenario: Grade items weights are normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set to zero (before the fix 20150619).
|
|
|
38 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
39 |
| Extra credit | 1 |
|
|
|
40 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
41 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
42 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
43 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
44 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
45 |
And I set the field "Weight of Test assignment five" to "60"
|
|
|
46 |
And I set the field "Weight of Test assignment six" to "40"
|
|
|
47 |
And I press "Save changes"
|
|
|
48 |
|
|
|
49 |
Then I should see "Your weights have been adjusted to total 100."
|
|
|
50 |
And the field "Weight of Test assignment five" matches value "60.000"
|
|
|
51 |
And the field "Weight of Test assignment six" matches value "40.000"
|
|
|
52 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
53 |
# The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
|
|
|
54 |
And I reset weights for grade category "Sub category 1"
|
|
|
55 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
56 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
57 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
58 |
|
|
|
59 |
@javascript
|
|
|
60 |
Scenario: Setting grade items weights is prevented when all grade item weights are overridden (sum over 100). Extra credit is set to zero (before the fix 20150619).
|
|
|
61 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
62 |
| Extra credit | 1 |
|
|
|
63 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
64 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
65 |
And I set the field "Weight of Test assignment five" to "60"
|
|
|
66 |
And I set the field "Weight of Test assignment six" to "50"
|
|
|
67 |
Then I should see "Weight total exceeds 100%." in the "Test assignment five" "table_row"
|
|
|
68 |
And I should see "Weight total exceeds 100%." in the "Test assignment six" "table_row"
|
|
|
69 |
And the field "Weight of Test assignment five" matches value "60.0"
|
|
|
70 |
And the field "Weight of Test assignment six" matches value "50.0"
|
|
|
71 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
72 |
And I start watching to see if a new page loads
|
|
|
73 |
And I press "Save changes"
|
|
|
74 |
And a new page should not have loaded since I started watching
|
|
|
75 |
And I reset weights for grade category "Sub category 1"
|
|
|
76 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
77 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
78 |
# The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
|
|
|
79 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
80 |
|
|
|
81 |
@javascript
|
|
|
82 |
Scenario: Setting grade items weights is prevented when all grade item weights are overridden (sum under 100). Extra credit is set to zero (before the fix 20150619).
|
|
|
83 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
84 |
| Extra credit | 1 |
|
|
|
85 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
86 |
And I set the field "Override weight of Test assignment six" to "1"
|
|
|
87 |
And I set the field "Weight of Test assignment five" to "40"
|
|
|
88 |
And I set the field "Weight of Test assignment six" to "30"
|
|
|
89 |
Then I should see "Weight total is less than 100%." in the "Test assignment five" "table_row"
|
|
|
90 |
And I should see "Weight total is less than 100%." in the "Test assignment six" "table_row"
|
|
|
91 |
And the field "Weight of Test assignment five" matches value "40.0"
|
|
|
92 |
And the field "Weight of Test assignment six" matches value "30.0"
|
|
|
93 |
And the field "Weight of Test assignment seven" matches value "0.0"
|
|
|
94 |
And I start watching to see if a new page loads
|
|
|
95 |
And I press "Save changes"
|
|
|
96 |
And a new page should not have loaded since I started watching
|
|
|
97 |
And I reset weights for grade category "Sub category 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 |
# The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
|
|
|
101 |
And the field "Weight of Test assignment seven" matches value "50.0"
|
|
|
102 |
|
|
|
103 |
@javascript
|
|
|
104 |
Scenario: Grade items weights are normalised when not all grade item weights are overridden. Extra credit is set respectful to non-overridden items (before the fix 20150619).
|
|
|
105 |
When I set the following settings for grade item "Test assignment seven" of type "gradeitem" on "setup" page:
|
|
|
106 |
| Extra credit | 1 |
|
|
|
107 |
And I set the field "Override weight of Test assignment five" to "1"
|
|
|
108 |
And I set the field "Weight of Test assignment five" to "40"
|
|
|
109 |
And I press "Save changes"
|
|
|
110 |
Then I should see "Your weights have been adjusted to total 100."
|
|
|
111 |
And the field "Weight of Test assignment five" matches value "40.00"
|
|
|
112 |
And the field "Weight of Test assignment six" matches value "60.000"
|
|
|
113 |
And the field "Weight of Test assignment seven" matches value "90.0"
|
|
|
114 |
# The weight of "seven" should be 15/30=50% (15 is the maxgrade for "seven" and 30 are max grades for this category (max grade of "five" plus max grade of "six")
|
|
|
115 |
And I reset weights for grade category "Sub category 1"
|
|
|
116 |
And the field "Weight of Test assignment five" matches value "66.667"
|
|
|
117 |
And the field "Weight of Test assignment six" matches value "33.333"
|
|
|
118 |
And the field "Weight of Test assignment seven" matches value "50.0"
|