1 |
efrain |
1 |
@core @core_grades
|
|
|
2 |
Feature: Calculated grade items can be used in the gradebook
|
|
|
3 |
In order to use calculated grade items in the gradebook
|
|
|
4 |
As a teacher
|
|
|
5 |
I need setup calculated grade items in the 'Gradebook setup' page.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
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@example.com | t1 |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com | s1 |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com | s2 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
|
|
|
22 |
|
|
|
23 |
@javascript
|
|
|
24 |
Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
|
|
|
25 |
Given I choose the "Add category" item in the "Add" action menu
|
|
|
26 |
And I set the following fields to these values:
|
|
|
27 |
| Category name | Calc cat |
|
|
|
28 |
And I click on "Save" "button" in the "New category" "dialogue"
|
|
|
29 |
And I wait until the page is ready
|
|
|
30 |
And I choose the "Add grade item" item in the "Add" action menu
|
|
|
31 |
And I set the following fields to these values:
|
|
|
32 |
| Item name | grade item 1 |
|
|
|
33 |
| Grade category | Calc cat |
|
|
|
34 |
And I click on "Save" "button" in the "New grade item" "dialogue"
|
|
|
35 |
And I set "=[[gi1]]/2" calculation for grade category "Calc cat" with idnumbers:
|
|
|
36 |
| grade item 1 | gi1 |
|
|
|
37 |
And I set the following settings for grade item "Calc cat" of type "category" on "setup" page:
|
|
|
38 |
| Maximum grade | 50 |
|
|
|
39 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
40 |
And I turn editing mode on
|
|
|
41 |
And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
|
|
|
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 |
And the following should exist in the "user-grade" table:
|
|
|
46 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
47 |
| grade item 1 | - | 75.00 | 0–100 | 75.00 % | - |
|
|
|
48 |
| Calc cat total | 100.00 % | 37.50 | 0–50 | 75.00 % | - |
|
|
|
49 |
| Course total | - | 37.50 | 0–50 | 75.00 % | - |
|
|
|
50 |
|
|
|
51 |
@javascript
|
|
|
52 |
Scenario: Changing max grade for a category item with a calculation that has existing grades will display the same points with the new max grade values immediately.
|
|
|
53 |
Given I choose the "Add category" item in the "Add" action menu
|
|
|
54 |
And I set the following fields to these values:
|
|
|
55 |
| Category name | Calc cat |
|
|
|
56 |
And I click on "Save" "button" in the "New category" "dialogue"
|
|
|
57 |
And I wait until the page is ready
|
|
|
58 |
And I should not see "Calculated grade" in the "Calc cat" "table_row"
|
|
|
59 |
And I choose the "Add grade item" item in the "Add" action menu
|
|
|
60 |
And I set the following fields to these values:
|
|
|
61 |
| Item name | grade item 1 |
|
|
|
62 |
| Grade category | Calc cat |
|
|
|
63 |
And I click on "Save" "button" in the "New grade item" "dialogue"
|
|
|
64 |
And I set "=[[gi1]]/2" calculation for grade category "Calc cat" with idnumbers:
|
|
|
65 |
| grade item 1 | gi1 |
|
|
|
66 |
And I should see "Calculated grade" in the "Calc cat" "table_row"
|
|
|
67 |
And I set the following settings for grade item "Calc cat" of type "category" on "setup" page:
|
|
|
68 |
| Maximum grade | 50 |
|
|
|
69 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
70 |
And I turn editing mode on
|
|
|
71 |
And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
|
|
|
72 |
And I press "Save changes"
|
|
|
73 |
And I navigate to "View > User report" in the course gradebook
|
|
|
74 |
And I click on "Student 1" in the "user" search widget
|
|
|
75 |
And the following should exist in the "user-grade" table:
|
|
|
76 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
77 |
| grade item 1 | - | 75.00 | 0–100 | 75.00 % | - |
|
|
|
78 |
| Calc cat total | 100.00 % | 37.50 | 0–50 | 75.00 % | - |
|
|
|
79 |
| Course total | - | 37.50 | 0–50 | 75.00 % | - |
|
|
|
80 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
81 |
And I set the following settings for grade item "Calc cat" of type "category" on "setup" page:
|
|
|
82 |
| Maximum grade | 40 |
|
|
|
83 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
84 |
And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
|
|
|
85 |
And I press "Save changes"
|
|
|
86 |
And I navigate to "View > User report" in the course gradebook
|
|
|
87 |
When I click on "Student 1" in the "user" search widget
|
|
|
88 |
Then the following should exist in the "user-grade" table:
|
|
|
89 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
90 |
| grade item 1 | - | 75.00 | 0–100 | 75.00 % | - |
|
|
|
91 |
| Calc cat total | 100.00 % | 37.50 | 0–40 | 93.75 % | - |
|
|
|
92 |
| Course total | - | 37.50 | 0–40 | 93.75 % | - |
|
|
|
93 |
And I click on "Student 2" in the "user" search widget
|
|
|
94 |
And the following should exist in the "user-grade" table:
|
|
|
95 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
96 |
| grade item 1 | - | 65.00 | 0–100 | 65.00 % | - |
|
|
|
97 |
| Calc cat total | 100.00 % | 32.50 | 0–40 | 81.25 % | - |
|
|
|
98 |
| Course total | - | 32.50 | 0–40 | 81.25 % | - |
|
|
|
99 |
And I navigate to "Setup > Course grade settings" in the course gradebook
|
|
|
100 |
And I set the following fields to these values:
|
|
|
101 |
| Min and max grades used in calculation | Initial min and max grades |
|
|
|
102 |
And I press "Save changes"
|
|
|
103 |
And I navigate to "View > User report" in the course gradebook
|
|
|
104 |
And I click on "Student 1" in the "user" search widget
|
|
|
105 |
And the following should exist in the "user-grade" table:
|
|
|
106 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
107 |
| grade item 1 | - | 75.00 | 0–100 | 75.00 % | - |
|
|
|
108 |
| Calc cat total | 100.00 % | 37.50 | 0–40 | 93.75 % | - |
|
|
|
109 |
| Course total | - | 37.50 | 0–40 | 93.75 % | - |
|
|
|
110 |
And I click on "Student 2" in the "user" search widget
|
|
|
111 |
And the following should exist in the "user-grade" table:
|
|
|
112 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
113 |
| grade item 1 | - | 65.00 | 0–100 | 65.00 % | - |
|
|
|
114 |
| Calc cat total | 100.00 % | 32.50 | 0–40 | 81.25 % | - |
|
|
|
115 |
| Course total | - | 32.50 | 0–40 | 81.25 % | - |
|
|
|
116 |
|
|
|
117 |
@javascript
|
|
|
118 |
Scenario: Values in calculated grade items are not always out of one hundred
|
|
|
119 |
Given I choose the "Add grade item" item in the "Add" action menu
|
|
|
120 |
And I set the following fields to these values:
|
|
|
121 |
| Item name | grade item 1 |
|
|
|
122 |
And I click on "Save" "button" in the "New grade item" "dialogue"
|
|
|
123 |
And I choose the "Add grade item" item in the "Add" action menu
|
|
|
124 |
And I set the following fields to these values:
|
|
|
125 |
| Item name | calc item |
|
|
|
126 |
And I click on "Save" "button" in the "New grade item" "dialogue"
|
|
|
127 |
And I set "=[[gi1]]/2" calculation for grade item "calc item" with idnumbers:
|
|
|
128 |
| grade item 1 | gi1 |
|
|
|
129 |
And I set the following settings for grade item "calc item" of type "gradeitem" on "setup" page:
|
|
|
130 |
| Maximum grade | 50 |
|
|
|
131 |
And I navigate to "Setup > Course grade settings" in the course gradebook
|
|
|
132 |
And I set the following fields to these values:
|
|
|
133 |
| Min and max grades used in calculation | Initial min and max grades |
|
|
|
134 |
And I press "Save changes"
|
|
|
135 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
136 |
And I turn editing mode on
|
|
|
137 |
And I give the grade "75.00" to the user "Student 1" for the grade item "grade item 1"
|
|
|
138 |
And I press "Save changes"
|
|
|
139 |
And I navigate to "View > User report" in the course gradebook
|
|
|
140 |
When I click on "Student 1" in the "user" search widget
|
|
|
141 |
Then the following should exist in the "user-grade" table:
|
|
|
142 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
143 |
| grade item 1 | 66.67 % | 75.00 | 0–100 | 75.00 % | 50.00 % |
|
|
|
144 |
| calc item | 33.33 % | 37.50 | 0–50 | 75.00 % | 25.00 % |
|
|
|
145 |
| Course total | - | 112.50 | 0–150 | 75.00 % | - |
|
|
|
146 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
147 |
And I set the following settings for grade item "calc item" of type "gradeitem" on "setup" page:
|
|
|
148 |
| Rescale existing grades | No |
|
|
|
149 |
| Maximum grade | 40 |
|
|
|
150 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
151 |
And I give the grade "65.00" to the user "Student 2" for the grade item "grade item 1"
|
|
|
152 |
And I press "Save changes"
|
|
|
153 |
And I navigate to "View > User report" in the course gradebook
|
|
|
154 |
And I click on "Student 1" in the "user" search widget
|
|
|
155 |
And the following should exist in the "user-grade" table:
|
|
|
156 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
157 |
| grade item 1 | 71.43 % | 75.00 | 0–100 | 75.00 % | 53.57 % |
|
|
|
158 |
| calc item | 28.57 % | 37.50 | 0–40 | 93.75 % | 26.79 % |
|
|
|
159 |
| Course total | - | 112.50 | 0–140 | 80.36 % | - |
|
|
|
160 |
And I click on "Student 2" in the "user" search widget
|
|
|
161 |
And the following should exist in the "user-grade" table:
|
|
|
162 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
163 |
| grade item 1 | 71.43 % | 65.00 | 0–100 | 65.00 % | 46.43 % |
|
|
|
164 |
| calc item | 28.57 % | 32.50 | 0–40 | 81.25 % | 23.21 % |
|
|
|
165 |
| Course total | - | 97.50 | 0–140 | 69.64 % | - |
|