2 Feature: We can choose what min or max grade to use when aggregating grades.
3 In order to what min or max grade to use
5 I can update modify a course setting
8 Scenario: Changing the min or max grade to use updates the grades accordingly
9 Given the following "courses" exist:
10 | fullname | shortname | category | groupmode |
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 | student2 | Student | 2 | student2@example.com | s2 |
17 And the following "course enrolments" exist:
18 | user | course | role |
19 | teacher1 | C1 | editingteacher |
20 | student1 | C1 | student |
21 | student2 | C1 | student |
22 And the following "grade categories" exist:
25 And I log in as "admin"
26 And I set the following administration settings values:
27 | grade_minmaxtouse | Min and max grades as specified in grade item settings |
28 And I am on site homepage
30 And I navigate to "Grades" node in "Course administration"
31 And I navigate to "Categories and items" node in "Grade administration > Setup"
32 And I press "Add grade item"
33 And I set the following fields to these values:
35 | Grade category | C1 |
36 And I press "Save changes"
37 And I press "Add grade item"
38 And I set the following fields to these values:
40 | Grade category | C1 |
41 And I press "Save changes"
42 And I press "Add grade item"
43 And I set the following fields to these values:
45 | Grade category | CAT1 |
46 And I press "Save changes"
47 And I press "Add grade item"
48 And I set the following fields to these values:
50 | Grade category | CAT1 |
51 And I press "Save changes"
52 And I navigate to "Course grade settings" node in "Grade administration > Setup"
53 And I set the field "Min and max grades used in calculation" to "Default (Min and max grades as specified in grade item settings)"
54 And I set the field "Show weightings" to "Show"
55 And I set the field "Show contribution to course total" to "Show"
56 And I press "Save changes"
57 And I navigate to "Categories and items" node in "Grade administration > Setup"
58 And I set the following settings for grade item "CAT1":
59 | Aggregation | Natural |
61 And I log in as "teacher1"
63 And I navigate to "Grades" node in "Course administration"
64 And I turn editing mode on
65 And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1"
66 And I give the grade "25.00" to the user "Student 1" for the grade item "MI 2"
67 And I give the grade "50.00" to the user "Student 1" for the grade item "MI 3"
68 And I give the grade "100.00" to the user "Student 1" for the grade item "MI 4"
69 And I give the grade "20.00" to the user "Student 2" for the grade item "MI 1"
70 And I give the grade "10.00" to the user "Student 2" for the grade item "MI 3"
71 And I press "Save changes"
72 And I follow "User report"
73 And I select "Student 1" from the "Select all or one user" singleselect
74 And the following should exist in the "user-grade" table:
75 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
76 | MI 1 | 25.00 % | 75.00 | 0–100 | 75.00 % | 18.75 % |
77 | MI 2 | 25.00 % | 25.00 | 0–100 | 25.00 % | 6.25 % |
78 | MI 3 | 50.00 % | 50.00 | 0–100 | 50.00 % | 12.50 % |
79 | MI 4 | 50.00 % | 100.00 | 0–100 | 100.00 % | 25.00 % |
80 | CAT1 total | 50.00 % | 150.00 | 0–200 | 75.00 % | - |
81 | Course total | - | 250.00 | 0–400 | 62.50 % | - |
82 And I select "Student 2" from the "Select all or one user" singleselect
83 And the following should exist in the "user-grade" table:
84 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
85 | MI 1 | 50.00 % | 20.00 | 0–100 | 20.00 % | 10.00 % |
86 | MI 2 | 0.00 % | - | 0–100 | - | 0.00 % |
87 | MI 3 | 100.00 % | 10.00 | 0–100 | 10.00 % | 5.00 % |
88 | MI 4 | 0.00 % | - | 0–100 | - | 0.00 % |
89 | CAT1 total | 50.00 % | 10.00 | 0–100 | 10.00 % | - |
90 | Course total | - | 30.00 | 0–200 | 15.00 % | - |
91 And I navigate to "Categories and items" node in "Grade administration > Setup"
92 And I set the following settings for grade item "MI 1":
93 | Maximum grade | 50.00 |
94 | Minimum grade | 5.00 |
95 And I set the following settings for grade item "MI 3":
96 | Maximum grade | 50.00 |
97 | Minimum grade | 5.00 |
98 And I follow "User report"
99 And I select "Student 1" from the "Select all or one user" singleselect
100 And the following should exist in the "user-grade" table:
101 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
102 | MI 1 | 16.67 % | 75.00 | 5–50 | 100.00 % | 25.00 % |
103 | MI 2 | 33.33 % | 25.00 | 0–100 | 25.00 % | 8.33 % |
104 | MI 3 | 33.33 % | 50.00 | 5–50 | 100.00 % | 16.67 % |
105 | MI 4 | 66.67 % | 100.00 | 0–100 | 100.00 % | 33.33 % |
106 | CAT1 total | 50.00 % | 150.00 | 0–150 | 100.00 % | - |
107 | Course total | - | 250.00 | 0–300 | 83.33 % | - |
108 And I select "Student 2" from the "Select all or one user" singleselect
109 And the following should exist in the "user-grade" table:
110 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
111 | MI 1 | 50.00 % | 20.00 | 5–50 | 33.33 % | 20.00 % |
112 | MI 2 | 0.00 % | - | 0–100 | - | 0.00 % |
113 | MI 3 | 100.00 % | 10.00 | 5–50 | 11.11 % | 10.00 % |
114 | MI 4 | 0.00 % | - | 0–100 | - | 0.00 % |
115 | CAT1 total | 50.00 % | 10.00 | 0–50 | 20.00 % | - |
116 | Course total | - | 30.00 | 0–100 | 30.00 % | - |
117 And I navigate to "Course grade settings" node in "Grade administration > Setup"
118 When I set the field "Min and max grades used in calculation" to "Initial min and max grades"
119 And I press "Save changes"
120 And I follow "User report"
121 And I select "Student 1" from the "Select all or one user" singleselect
122 Then the following should exist in the "user-grade" table:
123 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
124 | MI 1 | 25.00 % | 75.00 | 0–100 | 75.00 % | 18.75 % |
125 | MI 2 | 25.00 % | 25.00 | 0–100 | 25.00 % | 6.25 % |
126 | MI 3 | 50.00 % | 50.00 | 0–100 | 50.00 % | 12.50 % |
127 | MI 4 | 50.00 % | 100.00 | 0–100 | 100.00 % | 25.00 % |
128 | CAT1 total | 50.00 % | 150.00 | 0–200 | 75.00 % | - |
129 | Course total | - | 250.00 | 0–400 | 62.50 % | - |
130 And I select "Student 2" from the "Select all or one user" singleselect
131 And the following should exist in the "user-grade" table:
132 | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
133 | MI 1 | 50.00 % | 20.00 | 0–100 | 20.00 % | 10.00 % |
134 | MI 2 | 0.00 % | - | 0–100 | - | 0.00 % |
135 | MI 3 | 100.00 % | 10.00 | 0–100 | 10.00 % | 5.00 % |
136 | MI 4 | 0.00 % | - | 0–100 | - | 0.00 % |
137 | CAT1 total | 50.00 % | 10.00 | 0–100 | 10.00 % | - |
138 | Course total | - | 30.00 | 0–200 | 15.00 % | - |