1 |
efrain |
1 |
@core @core_grades @javascript
|
|
|
2 |
Feature: Teachers can toggle the visibility of the grade categories in the Gradebook setup page.
|
|
|
3 |
In order to focus only on the information that I am interested in
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to easily toggle the visibility of grade categories in the Gradebook setup page
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email | idnumber |
|
|
|
13 |
| teacher1 | Teacher 1 | 1 | teacher1@example.com | t1 |
|
|
|
14 |
| teacher2 | Teacher 2 | 2 | teacher2@example.com | t2 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| teacher2 | C1 | editingteacher |
|
|
|
19 |
And the following "grade categories" exist:
|
|
|
20 |
| fullname | course |
|
|
|
21 |
| Category 1 | C1 |
|
|
|
22 |
And the following "activities" exist:
|
|
|
23 |
| activity | course | idnumber | name | intro |
|
|
|
24 |
| assign | C1 | a1 | Test assignment one | Submit something! |
|
|
|
25 |
And the following "activities" exist:
|
|
|
26 |
| activity | course | idnumber | name | intro | gradecategory |
|
|
|
27 |
| assign | C1 | a2 | Test assignment two | Submit something! | Category 1 |
|
|
|
28 |
And the following "grade items" exist:
|
|
|
29 |
| itemname | grademax | course | gradecategory |
|
|
|
30 |
| Manual grade | 40 | C1 | Category 1 |
|
|
|
31 |
And I am on the "Course" "grades > gradebook setup" page logged in as "teacher1"
|
|
|
32 |
|
|
|
33 |
Scenario: A teacher can collapse and expand grade categories in the Gradebook setup page
|
|
|
34 |
Given the following should exist in the "setup-grades" table:
|
|
|
35 |
| Name |
|
|
|
36 |
| Course |
|
|
|
37 |
| Test assignment one |
|
|
|
38 |
| Category 1 |
|
|
|
39 |
| Test assignment two |
|
|
|
40 |
| Manual grade |
|
|
|
41 |
| Category 1 total |
|
|
|
42 |
| Course total |
|
|
|
43 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
44 |
And "Collapse" "link" should exist in the "Category 1" "table_row"
|
|
|
45 |
# Collapse the grade category 'Category 1'.
|
|
|
46 |
When I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
47 |
Then the following should exist in the "setup-grades" table:
|
|
|
48 |
| Name |
|
|
|
49 |
| Course |
|
|
|
50 |
| Test assignment one |
|
|
|
51 |
| Category 1 |
|
|
|
52 |
| Course total |
|
|
|
53 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
54 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
55 |
And the following should not exist in the "setup-grades" table:
|
|
|
56 |
| Test assignment two |
|
|
|
57 |
| Manual grade |
|
|
|
58 |
| Category 1 total |
|
|
|
59 |
# Expand the grade category 'Category 1'.
|
|
|
60 |
And I click on "Expand" "link" in the "Category 1" "table_row"
|
|
|
61 |
And the following should exist in the "setup-grades" table:
|
|
|
62 |
| Name |
|
|
|
63 |
| Course |
|
|
|
64 |
| Test assignment one |
|
|
|
65 |
| Category 1 |
|
|
|
66 |
| Test assignment two |
|
|
|
67 |
| Manual grade |
|
|
|
68 |
| Category 1 total |
|
|
|
69 |
| Course total |
|
|
|
70 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
71 |
And "Collapse" "link" should exist in the "Category 1" "table_row"
|
|
|
72 |
# Collapse again the grade category 'Category 1'.
|
|
|
73 |
And I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
74 |
# Collapse the grade category 'Course'.
|
|
|
75 |
And I click on "Collapse" "link" in the "Course" "table_row"
|
|
|
76 |
And the following should exist in the "setup-grades" table:
|
|
|
77 |
| Name |
|
|
|
78 |
| Course |
|
|
|
79 |
And I should see "Course" in the "setup-grades" "table"
|
|
|
80 |
And "Expand" "link" should exist in the "Course" "table_row"
|
|
|
81 |
And the following should not exist in the "setup-grades" table:
|
|
|
82 |
| Name |
|
|
|
83 |
| Test assignment one |
|
|
|
84 |
| Category 1 |
|
|
|
85 |
| Test assignment two |
|
|
|
86 |
| Manual grade |
|
|
|
87 |
| Category 1 total |
|
|
|
88 |
| Course total |
|
|
|
89 |
# Expand the grade category 'Course'. 'Category 1' should be still collapsed.
|
|
|
90 |
And I click on "Expand" "link" in the "Course" "table_row"
|
|
|
91 |
And the following should exist in the "setup-grades" table:
|
|
|
92 |
| Name |
|
|
|
93 |
| Course |
|
|
|
94 |
| Test assignment one |
|
|
|
95 |
| Category 1 |
|
|
|
96 |
| Course total |
|
|
|
97 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
98 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
99 |
And the following should not exist in the "setup-grades" table:
|
|
|
100 |
| Name |
|
|
|
101 |
| Test assignment two |
|
|
|
102 |
| Manual grade |
|
|
|
103 |
| Category 1 total |
|
|
|
104 |
|
|
|
105 |
Scenario: A teacher can see the aggregated max grade for a grade category even when the category is collapsed
|
|
|
106 |
Given the following should exist in the "setup-grades" table:
|
|
|
107 |
| Name | Max grade |
|
|
|
108 |
| Course | |
|
|
|
109 |
| Category 1 | |
|
|
|
110 |
| Category 1 total | 140.00 |
|
|
|
111 |
| Course total | 240.00 |
|
|
|
112 |
# Collapse the grade category 'Category 1'. The aggregated max grade should now be displayed within the 'Category 1' row.
|
|
|
113 |
When I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
114 |
Then the following should exist in the "setup-grades" table:
|
|
|
115 |
| Name | Max grade |
|
|
|
116 |
| Course | |
|
|
|
117 |
| Category 1 | 140.00 |
|
|
|
118 |
| Course total | 240.00 |
|
|
|
119 |
And I should not see "Category 1 total" in the "setup-grades" "table"
|
|
|
120 |
# Collapse the grade category 'Course'. The aggregated max grade should now be displayed within the 'Course' row.
|
|
|
121 |
And I click on "Collapse" "link" in the "Course" "table_row"
|
|
|
122 |
And "Course" row "Max grade" column of "setup-grades" table should contain "240.00"
|
|
|
123 |
And I should not see "Course total" in the "setup-grades" "table"
|
|
|
124 |
# Expand the grade category 'Course'. The aggregated max grade should not be displayed within the 'Course' row anymore.
|
|
|
125 |
And I click on "Expand" "link" in the "Course" "table_row"
|
|
|
126 |
And the following should exist in the "setup-grades" table:
|
|
|
127 |
| Name | Max grade |
|
|
|
128 |
| Course | |
|
|
|
129 |
| Category 1 | 140.00 |
|
|
|
130 |
| Course total | 240.00 |
|
|
|
131 |
And I should not see "Category 1 total" in the "setup-grades" "table"
|
|
|
132 |
|
|
|
133 |
Scenario: A teacher can collapse and expand grade categories in the Gradebook setup when moving grade items
|
|
|
134 |
Given I click on "Move" "link" in the "Test assignment one" "table_row"
|
|
|
135 |
And the following should exist in the "setup-grades" table:
|
|
|
136 |
| Name |
|
|
|
137 |
| Course |
|
|
|
138 |
| Test assignment one |
|
|
|
139 |
| Category 1 |
|
|
|
140 |
| Test assignment two |
|
|
|
141 |
| Manual grade |
|
|
|
142 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
143 |
And "Collapse" "link" should exist in the "Category 1" "table_row"
|
|
|
144 |
# Collapse the grade category 'Category 1'.
|
|
|
145 |
When I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
146 |
Then the following should exist in the "setup-grades" table:
|
|
|
147 |
| Name |
|
|
|
148 |
| Course |
|
|
|
149 |
| Test assignment one |
|
|
|
150 |
| Category 1 |
|
|
|
151 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
152 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
153 |
And the following should not exist in the "setup-grades" table:
|
|
|
154 |
| Name |
|
|
|
155 |
| Test assignment two |
|
|
|
156 |
| Manual grade |
|
|
|
157 |
| Category 1 total |
|
|
|
158 |
# Expand the grade category 'Category 1'.
|
|
|
159 |
And I click on "Expand" "link" in the "Category 1" "table_row"
|
|
|
160 |
And the following should exist in the "setup-grades" table:
|
|
|
161 |
| Name |
|
|
|
162 |
| Course |
|
|
|
163 |
| Test assignment one |
|
|
|
164 |
| Category 1 |
|
|
|
165 |
| Test assignment two |
|
|
|
166 |
| Manual grade |
|
|
|
167 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
168 |
And "Collapse" "link" should exist in the "Category 1" "table_row"
|
|
|
169 |
# Collapse again the grade category 'Category 1'.
|
|
|
170 |
And I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
171 |
# Collapse the grade category 'Course'.
|
|
|
172 |
And I click on "Collapse" "link" in the "Course" "table_row"
|
|
|
173 |
And I should see "Course" in the "setup-grades" "table"
|
|
|
174 |
And "Expand" "link" should exist in the "Course" "table_row"
|
|
|
175 |
And the following should not exist in the "setup-grades" table:
|
|
|
176 |
| Name |
|
|
|
177 |
| Test assignment one |
|
|
|
178 |
| Category 1 |
|
|
|
179 |
| Test assignment two |
|
|
|
180 |
| Manual grade |
|
|
|
181 |
# Expand the grade category 'Course'. 'Category 1' should be still collapsed.
|
|
|
182 |
And I click on "Expand" "link" in the "Course" "table_row"
|
|
|
183 |
And the following should exist in the "setup-grades" table:
|
|
|
184 |
| Name |
|
|
|
185 |
| Course |
|
|
|
186 |
| Test assignment one |
|
|
|
187 |
| Category 1 |
|
|
|
188 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
189 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
190 |
And the following should not exist in the "setup-grades" table:
|
|
|
191 |
| Name |
|
|
|
192 |
| Test assignment two |
|
|
|
193 |
| Manual grade |
|
|
|
194 |
| Category 1 total |
|
|
|
195 |
|
|
|
196 |
Scenario: Previously collapsed categories are still shown as collapsed when a teacher navigates back to Gradebook setup
|
|
|
197 |
# Collapse the grade category 'Category 1' and navigate to the course homepage.
|
|
|
198 |
Given I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
199 |
# Navigate back to Gradebook setup and confirm that the category 'Category 1' is still collapsed.
|
|
|
200 |
When I am on the "Course" "grades > gradebook setup" page
|
|
|
201 |
Then the following should exist in the "setup-grades" table:
|
|
|
202 |
| Name |
|
|
|
203 |
| Course |
|
|
|
204 |
| Test assignment one |
|
|
|
205 |
| Category 1 |
|
|
|
206 |
| Course total |
|
|
|
207 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
208 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
209 |
And the following should not exist in the "setup-grades" table:
|
|
|
210 |
| Name |
|
|
|
211 |
| Test assignment two |
|
|
|
212 |
| Manual grade |
|
|
|
213 |
| Category 1 total |
|
|
|
214 |
|
|
|
215 |
Scenario: Previously collapsed categories are still shown as collapsed when a teacher is moving grade items in Gradebook setup
|
|
|
216 |
# Collapse the grade category 'Category 1'.
|
|
|
217 |
Given I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
218 |
# Attempt to move a grade item and confirm that the category 'Category 1' is still collapsed.
|
|
|
219 |
When I click on "Move" "link" in the "Test assignment one" "table_row"
|
|
|
220 |
Then the following should exist in the "setup-grades" table:
|
|
|
221 |
| Name |
|
|
|
222 |
| Course |
|
|
|
223 |
| Test assignment one |
|
|
|
224 |
| Category 1 |
|
|
|
225 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
226 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
227 |
And the following should not exist in the "setup-grades" table:
|
|
|
228 |
| Name |
|
|
|
229 |
| Test assignment two |
|
|
|
230 |
| Manual grade |
|
|
|
231 |
| Category 1 total |
|
|
|
232 |
|
|
|
233 |
Scenario: Grade categories are shown as collapsed only to the teacher that collapsed them
|
|
|
234 |
# Collapse the grade category 'Category 1'.
|
|
|
235 |
Given I click on "Collapse" "link" in the "Category 1" "table_row"
|
|
|
236 |
# Log in as teacher2 and confirm that the category 'Category 1' is not collapsed.
|
|
|
237 |
When I am on the "Course" "grades > gradebook setup" page logged in as "teacher2"
|
|
|
238 |
Then the following should exist in the "setup-grades" table:
|
|
|
239 |
| Name |
|
|
|
240 |
| Course |
|
|
|
241 |
| Test assignment one |
|
|
|
242 |
| Category 1 |
|
|
|
243 |
| Test assignment two |
|
|
|
244 |
| Manual grade |
|
|
|
245 |
| Category 1 total |
|
|
|
246 |
| Course total |
|
|
|
247 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
248 |
And "Collapse" "link" should exist in the "Category 1" "table_row"
|
|
|
249 |
# Log in as teacher1 and confirm that the category 'Category 1' is still collapsed.
|
|
|
250 |
And I am on the "Course" "grades > gradebook setup" page logged in as "teacher1"
|
|
|
251 |
And the following should exist in the "setup-grades" table:
|
|
|
252 |
| Name |
|
|
|
253 |
| Course |
|
|
|
254 |
| Test assignment one |
|
|
|
255 |
| Category 1 |
|
|
|
256 |
| Course total |
|
|
|
257 |
And "Collapse" "link" should exist in the "Course" "table_row"
|
|
|
258 |
And "Expand" "link" should exist in the "Category 1" "table_row"
|
|
|
259 |
And the following should not exist in the "setup-grades" table:
|
|
|
260 |
| Name |
|
|
|
261 |
| Test assignment two |
|
|
|
262 |
| Manual grade |
|
|
|
263 |
| Category 1 total |
|