2 Feature: We can understand the gradebook user report
3 In order to understand the gradebook user report
5 I need to see the calculated weights for each type of aggregation
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@asd.com | t1 |
14 | student1 | Student | 1 | student1@asd.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 "activities" exist:
20 | activity | course | idnumber | name | intro |
21 | assign | C1 | a1 | Test assignment one | Submit something! |
22 | assign | C1 | a2 | Test assignment two | Submit something! |
23 | assign | C1 | a3 | Test assignment three | Submit something! |
24 | assign | C1 | a4 | Test assignment four | Submit something! |
25 | assign | C1 | a5 | Test assignment five | Submit something! |
26 | assign | C1 | a6 | Test assignment six | Submit something! |
27 And I log in as "admin"
28 And I set the following administration settings values:
29 | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
31 And I log in as "teacher1"
32 And I follow "Course 1"
34 And I turn editing mode on
35 And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one"
36 And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two"
37 And I give the grade "40.00" to the user "Student 1" for the grade item "Test assignment three"
38 And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four"
39 And I give the grade "70.00" to the user "Student 1" for the grade item "Test assignment five"
40 And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment six"
41 And I press "Save changes"
42 And I navigate to "Course grade settings" node in "Grade administration > Settings"
43 And I set the field "Show weightings" to "Show"
44 And I set the field "Show contribution to course total" to "Show"
45 And I press "Save changes"
46 And I set the field "Grade report" to "Set up grades layout"
47 And I press "Add category"
48 And I set the field "Category name" to "Sub category"
49 And I press "Save changes"
50 And I click on "Move" "link" in the "Test assignment six" "table_row"
51 # This xpath finds the forth last row in the table.
52 And I click on "Move to here" "link" in the "//tbody//tr[position()=last()-3]" "xpath_element"
53 And I click on "Move" "link" in the "Test assignment five" "table_row"
54 And I click on "Move to here" "link" in the "//tbody//tr[position()=last()-3]" "xpath_element"
55 And I click on "Move" "link" in the "Test assignment four" "table_row"
56 And I click on "Move to here" "link" in the "//tbody//tr[position()=last()-3]" "xpath_element"
59 Scenario: Mean of grades aggregation
60 And I set the following settings for grade item "Course 1":
61 | Aggregation | Mean of grades |
62 And I set the field "Grade report" to "User report"
63 And I set the field "Select all or one user" to "Student 1"
65 # Check the values in the weights column.
66 Then the following should exist in the "user-grade" table:
67 | Grade item | Calculated weight | Grade | Contribution to course total |
68 | Test assignment one | 25.00 % | 60.00 | 15.00 |
69 | Test assignment two | 25.00 % | 20.00 | 5.00 |
70 | Test assignment three | 25.00 % | 40.00 | 10.00 |
71 | Test assignment four | 33.33 % | 10.00 | 0.83 |
72 | Test assignment five | 33.33 % | 70.00 | 5.83 |
73 | Test assignment six | 33.33 % | 30.00 | 2.50 |
76 Scenario: Weighted mean of grades aggregation
77 And I set the following settings for grade item "Course 1":
78 | Aggregation | Weighted mean of grades |
79 And I set the following settings for grade item "Test assignment one":
81 And I set the following settings for grade item "Test assignment two":
83 And I set the following settings for grade item "Test assignment three":
85 And I set the following settings for grade item "Sub category":
87 And I set the field "Grade report" to "User report"
88 And I set the field "Select all or one user" to "Student 1"
90 # Check the values in the weights column.
91 Then the following should exist in the "user-grade" table:
92 | Grade item | Calculated weight | Grade | Contribution to course total |
93 | Test assignment one | 40.00 % | 60.00 | 24.00 |
94 | Test assignment two | 20.00 % | 20.00 | 4.00 |
95 | Test assignment three | 20.00 % | 40.00 | 8.00 |
96 | Test assignment four | 33.33 % | 10.00 | 0.67 |
97 | Test assignment five | 33.33 % | 70.00 | 4.67 |
98 | Test assignment six | 33.33 % | 30.00 | 2.00 |
101 Scenario: Simple weighted mean of grades aggregation
102 And I set the following settings for grade item "Course 1":
103 | Aggregation | Simple weighted mean of grades |
104 And I set the following settings for grade item "Test assignment three":
106 And I set the field "Grade report" to "User report"
107 And I set the field "Select all or one user" to "Student 1"
109 # Check the values in the weights column.
110 Then the following should exist in the "user-grade" table:
111 | Grade item | Calculated weight | Grade | Contribution to course total |
112 | Test assignment one | 33.33 % | 60.00 | 20.00 |
113 | Test assignment two | 33.33 % | 20.00 | 6.67 |
114 | Test assignment three | 33.33 %( Extra credit ) | 40.00 | 13.33 |
115 | Test assignment four | 33.33 % | 10.00 | 1.11 |
116 | Test assignment five | 33.33 % | 70.00 | 7.78 |
117 | Test assignment six | 33.33 % | 30.00 | 3.33 |
120 Scenario: Mean of grades (with extra credits) aggregation
121 And I set the following settings for grade item "Course 1":
122 | Aggregation | Mean of grades (with extra credits) |
123 And I set the following settings for grade item "Test assignment three":
124 | Extra credit weight | 1.0 |
125 And I set the field "Grade report" to "User report"
126 And I set the field "Select all or one user" to "Student 1"
128 # Check the values in the weights column.
129 Then the following should exist in the "user-grade" table:
130 | Grade item | Calculated weight | Grade | Contribution to course total |
131 | Test assignment one | 33.33 % | 60.00 | 20.00 |
132 | Test assignment two | 33.33 % | 20.00 | 6.67 |
133 | Test assignment three | 33.33 %( Extra credit ) | 40.00 | 13.33 |
134 | Test assignment four | 33.33 % | 10.00 | 1.11 |
135 | Test assignment five | 33.33 % | 70.00 | 7.78 |
136 | Test assignment six | 33.33 % | 30.00 | 3.33 |
139 Scenario: Median of grades aggregation
140 And I set the following settings for grade item "Course 1":
141 | Aggregation | Median of grades |
142 And I set the field "Grade report" to "User report"
143 And I set the field "Select all or one user" to "Student 1"
145 # Check the values in the weights column.
146 Then the following should exist in the "user-grade" table:
147 | Grade item | Calculated weight | Grade | Contribution to course total |
148 | Test assignment one | 0.00 % | 60.00 | 0.00 |
149 | Test assignment two | 0.00 % | 20.00 | 0.00 |
150 | Test assignment three | 50.00 % | 40.00 | 20.00 |
151 | Test assignment four | 33.33 % | 10.00 | 1.67 |
152 | Test assignment five | 33.33 % | 70.00 | 11.67 |
153 | Test assignment six | 33.33 % | 30.00 | 5.00 |
156 Scenario: Lowest grade aggregation
157 And I set the following settings for grade item "Course 1":
158 | Aggregation | Lowest grade |
159 And I set the field "Grade report" to "User report"
160 And I set the field "Select all or one user" to "Student 1"
162 # Check the values in the weights column.
163 Then the following should exist in the "user-grade" table:
164 | Grade item | Calculated weight | Grade | Contribution to course total |
165 | Test assignment one | 0.00 % | 60.00 | 0.00 |
166 | Test assignment two | 100.00 % | 20.00 | 20.00 |
167 | Test assignment three | 0.00 % | 40.00 | 0.00 |
168 | Test assignment four | 33.33 % | 10.00 | 0.00 |
169 | Test assignment five | 33.33 % | 70.00 | 0.00 |
170 | Test assignment six | 33.33 % | 30.00 | 0.00 |
173 Scenario: Highest grade aggregation
174 And I set the following settings for grade item "Course 1":
175 | Aggregation | Highest grade |
176 And I set the field "Grade report" to "User report"
177 And I set the field "Select all or one user" to "Student 1"
179 # Check the values in the weights column.
180 Then the following should exist in the "user-grade" table:
181 | Grade item | Calculated weight | Grade | Contribution to course total |
182 | Test assignment one | 100.00 % | 60.00 | 60.00 |
183 | Test assignment two | 0.00 % | 20.00 | 0.00 |
184 | Test assignment three | 0.00 % | 40.00 | 0.00 |
185 | Test assignment four | 33.33 % | 10.00 | 0.00 |
186 | Test assignment five | 33.33 % | 70.00 | 0.00 |
187 | Test assignment six | 33.33 % | 30.00 | 0.00 |
190 Scenario: Mode of grades aggregation
191 And I set the following settings for grade item "Course 1":
192 | Aggregation | Mode of grades |
193 And I set the field "Grade report" to "User report"
194 And I set the field "Select all or one user" to "Student 1"
196 # Check the values in the weights column.
197 Then the following should exist in the "user-grade" table:
198 | Grade item | Calculated weight | Grade | Contribution to course total |
199 | Test assignment one | 100.00 % | 60.00 | 60.00 |
200 | Test assignment two | 0.00 % | 20.00 | 0.00 |
201 | Test assignment three | 0.00 % | 40.00 | 0.00 |
202 | Test assignment four | 33.33 % | 10.00 | 0.00 |
203 | Test assignment five | 33.33 % | 70.00 | 0.00 |
204 | Test assignment six | 33.33 % | 30.00 | 0.00 |
207 Scenario: Natural aggregation
208 And I set the following settings for grade item "Course 1":
209 | Aggregation | Natural |
210 And I set the following settings for grade item "Test assignment three":
212 And I set the field "Grade report" to "User report"
213 And I set the field "Select all or one user" to "Student 1"
215 # Check the values in the weights column.
216 Then the following should exist in the "user-grade" table:
217 | Grade item | Calculated weight | Grade | Contribution to course total |
218 | Test assignment one | 33.33 % | 60.00 | 60.00 |
219 | Test assignment two | 33.33 % | 20.00 | 20.00 |
220 | Test assignment three | 33.33 %( Extra credit ) | 40.00 | 40.00 |
221 | Test assignment four | 33.33 % | 10.00 | 3.33 |
222 | Test assignment five | 33.33 % | 70.00 | 23.33 |
223 | Test assignment six | 33.33 % | 30.00 | 10.00 |