1 |
efrain |
1 |
@core @core_grades @gradereport_user @javascript
|
|
|
2 |
Feature: View the user report as the student will see it
|
|
|
3 |
In order to know what grades students will see
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to view the user report as that other user
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| <span class="multilang" lang="en">Course</span><span class="multilang" lang="de">Kurs</span> 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 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "grade categories" exist:
|
|
|
20 |
| fullname | course |
|
|
|
21 |
| Sub category 1 | C1 |
|
|
|
22 |
| Sub category 2 | C1 |
|
|
|
23 |
And the following "activities" exist:
|
|
|
24 |
| activity | course | idnumber | name | intro | gradecategory | grade | gradepass |
|
|
|
25 |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 | 100 | 50 |
|
|
|
26 |
| assign | C1 | a2 | Test assignment two | Submit something! | Sub category 1 | 100 | 50 |
|
|
|
27 |
| assign | C1 | a3 | Test assignment three | Submit something! | Sub category 2 | 100 | |
|
|
|
28 |
| assign | C1 | a4 | Test assignment four | Submit something! | Sub category 2 | 100 | |
|
|
|
29 |
And the following "activities" exist:
|
|
|
30 |
| activity | course | idnumber | name | intro | grade |
|
|
|
31 |
| assign | C1 | a5 | Test assignment five | Submit something! | 100 |
|
|
|
32 |
| assign | C1 | a6 | Test assignment six | Submit something! | 100 |
|
|
|
33 |
And the "multilang" filter is "on"
|
|
|
34 |
And the "multilang" filter applies to "content and headings"
|
|
|
35 |
When I am on the "C1" "grades > gradebook setup" page logged in as "teacher1"
|
|
|
36 |
And I hide the grade item "Test assignment six" of type "gradeitem" on "setup" page
|
|
|
37 |
And I hide the grade item "Sub category 2" of type "category" on "setup" page
|
|
|
38 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
39 |
And I turn editing mode on
|
|
|
40 |
And I change window size to "large"
|
|
|
41 |
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one"
|
|
|
42 |
And I give the grade "35.00" to the user "Student 1" for the grade item "Test assignment two"
|
|
|
43 |
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment three"
|
|
|
44 |
And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment four"
|
|
|
45 |
And I give the grade "21.00" to the user "Student 1" for the grade item "Test assignment five"
|
|
|
46 |
And I give the grade "97.00" to the user "Student 1" for the grade item "Test assignment six"
|
|
|
47 |
And I press "Save changes"
|
|
|
48 |
And I change window size to "medium"
|
|
|
49 |
|
|
|
50 |
Scenario: View the report as the teacher themselves
|
|
|
51 |
Given the following "activities" exist:
|
|
|
52 |
| activity | course | idnumber | name | intro | grade |
|
|
|
53 |
| quiz | C1 | q1 | Test quiz one | Submit something! | 100 |
|
|
|
54 |
When I navigate to "View > User report" in the course gradebook
|
|
|
55 |
And I click on "Student 1" in the "user" search widget
|
|
|
56 |
And I should see "Course 1 & '\""
|
|
|
57 |
And I should not see "Course 1 & '\""
|
|
|
58 |
And I set the field "View report as" to "Myself"
|
|
|
59 |
Then the following should exist in the "user-grade" table:
|
|
|
60 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
61 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % |
|
|
|
62 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % |
|
|
|
63 |
| Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - |
|
|
|
64 |
| Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % |
|
|
|
65 |
| Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % |
|
|
|
66 |
| Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - |
|
|
|
67 |
| Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % |
|
|
|
68 |
| Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % |
|
|
|
69 |
| Test quiz one | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % |
|
|
|
70 |
| Course total | - | 383.00 | 0–600 | 63.83 % | - |
|
|
|
71 |
# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".
|
|
|
72 |
And I open the action menu in "Test quiz one" "table_row"
|
|
|
73 |
And "Grade analysis" "link" should exist
|
|
|
74 |
|
|
|
75 |
Scenario: View the report as the student from both the teachers and students perspective
|
|
|
76 |
Given the following "activities" exist:
|
|
|
77 |
| activity | course | idnumber | name | intro | grade |
|
|
|
78 |
| quiz | C1 | q1 | Test quiz one | Submit something! | 100 |
|
|
|
79 |
When I navigate to "View > User report" in the course gradebook
|
|
|
80 |
And I click on "Student 1" in the "user" search widget
|
|
|
81 |
And I set the field "View report as" to "User"
|
|
|
82 |
Then the following should exist in the "user-grade" table:
|
|
|
83 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
84 |
| Test assignment one | - | 80.00 | 0–100 | 80.00 % | - |
|
|
|
85 |
| Test assignment two | - | 35.00 | 0–100 | 35.00 % | - |
|
|
|
86 |
| Sub category 1 total | 33.33 % | - | 0–200 | - | - |
|
|
|
87 |
| Test assignment five | - | 21.00 | 0–100 | 21.00 % | - |
|
|
|
88 |
| Test quiz one | - | - | 0–100 | - | - |
|
|
|
89 |
| Course total | - | - | 0–600 | - | - |
|
|
|
90 |
And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"
|
|
|
91 |
And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"
|
|
|
92 |
And the following should not exist in the "user-grade" table:
|
|
|
93 |
| Grade item |
|
|
|
94 |
| Test assignment three |
|
|
|
95 |
| Test assignment four |
|
|
|
96 |
| Sub category 2 total |
|
|
|
97 |
| Test assignment six |
|
|
|
98 |
# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".
|
|
|
99 |
And I open the action menu in "Test quiz one" "table_row"
|
|
|
100 |
And "Grade analysis" "link" should exist
|
|
|
101 |
And I log out
|
|
|
102 |
And I am on the "C1" "Course" page logged in as "student1"
|
|
|
103 |
And I navigate to "User report" in the course gradebook
|
|
|
104 |
And the following should exist in the "user-grade" table:
|
|
|
105 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
106 |
| Test assignment one | - | 80.00 | 0–100 | 80.00 % | - |
|
|
|
107 |
| Test assignment two | - | 35.00 | 0–100 | 35.00 % | - |
|
|
|
108 |
| Sub category 1 total | 33.33 % | - | 0–200 | - | - |
|
|
|
109 |
| Test assignment five | - | 21.00 | 0–100 | 21.00 % | - |
|
|
|
110 |
| Test quiz one | - | - | 0–100 | - | - |
|
|
|
111 |
| Course total | - | - | 0–600 | - | - |
|
|
|
112 |
And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"
|
|
|
113 |
And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"
|
|
|
114 |
And the following should not exist in the "user-grade" table:
|
|
|
115 |
| Grade item |
|
|
|
116 |
| Test assignment three |
|
|
|
117 |
| Test assignment four |
|
|
|
118 |
| Sub category 2 total |
|
|
|
119 |
| Test assignment six |
|
|
|
120 |
# Confirm a contextual menu with a link to the Grade analysis page is available for "Test quiz one".
|
|
|
121 |
And I open the action menu in "Test quiz one" "table_row"
|
|
|
122 |
And "Grade analysis" "link" should exist
|
|
|
123 |
|
|
|
124 |
Scenario: View the report as the student from both the teachers and students perspective with totals excluding hidden
|
|
|
125 |
Given I navigate to "Setup > Course grade settings" in the course gradebook
|
|
|
126 |
And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items"
|
|
|
127 |
And I press "Save changes"
|
|
|
128 |
And I navigate to "View > User report" in the course gradebook
|
|
|
129 |
When I click on "Student 1" in the "user" search widget
|
|
|
130 |
And I set the field "View report as" to "User"
|
|
|
131 |
Then the following should exist in the "user-grade" table:
|
|
|
132 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
133 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % |
|
|
|
134 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 11.67 % |
|
|
|
135 |
| Sub category 1 total | 66.67 % | 115.00 | 0–200 | 57.50 | - |
|
|
|
136 |
| Test assignment five | 33.33 % | 21.00 | 0–100 | 21.00 % | 7.00 % |
|
|
|
137 |
| Course total | - | 136.00 | 0–300 | 45.33 % | - |
|
|
|
138 |
And the following should not exist in the "user-grade" table:
|
|
|
139 |
| Grade item |
|
|
|
140 |
| Test assignment three |
|
|
|
141 |
| Test assignment four |
|
|
|
142 |
| Sub category 2 total |
|
|
|
143 |
| Test assignment six |
|
|
|
144 |
And I log out
|
|
|
145 |
And I am on the "C1" "Course" page logged in as "student1"
|
|
|
146 |
And I navigate to "User report" in the course gradebook
|
|
|
147 |
Then the following should exist in the "user-grade" table:
|
|
|
148 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
149 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % |
|
|
|
150 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 11.67 % |
|
|
|
151 |
| Sub category 1 total | 66.67 % | 115.00 | 0–200 | 57.50 | - |
|
|
|
152 |
| Test assignment five | 33.33 % | 21.00 | 0–100 | 21.00 % | 7.00 % |
|
|
|
153 |
| Course total | - | 136.00 | 0–300 | 45.33 % | - |
|
|
|
154 |
And the following should not exist in the "user-grade" table:
|
|
|
155 |
| Grade item |
|
|
|
156 |
| Test assignment three |
|
|
|
157 |
| Test assignment four |
|
|
|
158 |
| Sub category 2 total |
|
|
|
159 |
| Test assignment six |
|
|
|
160 |
|
|
|
161 |
Scenario: View the report as the student from both the teachers and students perspective with totals including hidden
|
|
|
162 |
Given I navigate to "Setup > Course grade settings" in the course gradebook
|
|
|
163 |
And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals including hidden items"
|
|
|
164 |
And I press "Save changes"
|
|
|
165 |
And I navigate to "View > User report" in the course gradebook
|
|
|
166 |
When I click on "Student 1" in the "user" search widget
|
|
|
167 |
And I set the field "View report as" to "User"
|
|
|
168 |
Then the following should exist in the "user-grade" table:
|
|
|
169 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
170 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % |
|
|
|
171 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % |
|
|
|
172 |
| Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - |
|
|
|
173 |
| Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % |
|
|
|
174 |
| Course total | - | 383.00 | 0–600 | 63.83 % | - |
|
|
|
175 |
And the following should not exist in the "user-grade" table:
|
|
|
176 |
| Grade item |
|
|
|
177 |
| Test assignment three |
|
|
|
178 |
| Test assignment four |
|
|
|
179 |
| Sub category 2 total |
|
|
|
180 |
| Test assignment six |
|
|
|
181 |
And I log out
|
|
|
182 |
And I am on the "C1" "Course" page logged in as "student1"
|
|
|
183 |
And I navigate to "User report" in the course gradebook
|
|
|
184 |
Then the following should exist in the "user-grade" table:
|
|
|
185 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
186 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % |
|
|
|
187 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % |
|
|
|
188 |
| Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - |
|
|
|
189 |
| Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % |
|
|
|
190 |
| Course total | - | 383.00 | 0–600 | 63.83 % | - |
|
|
|
191 |
And the following should not exist in the "user-grade" table:
|
|
|
192 |
| Grade item |
|
|
|
193 |
| Test assignment three |
|
|
|
194 |
| Test assignment four |
|
|
|
195 |
| Sub category 2 total |
|
|
|
196 |
| Test assignment six |
|
|
|
197 |
|
|
|
198 |
Scenario: View the report as the student from both the teachers and students perspective when the student can view hidden
|
|
|
199 |
Given the following "role capability" exists:
|
|
|
200 |
| role | student |
|
|
|
201 |
| moodle/grade:viewhidden | allow |
|
|
|
202 |
And I am on the "C1" "Course" page logged in as "teacher1"
|
|
|
203 |
And I navigate to "Setup > Course grade settings" in the course gradebook
|
|
|
204 |
And I set the field with xpath "//select[@name='report_user_showtotalsifcontainhidden']" to "Show totals excluding hidden items"
|
|
|
205 |
And I press "Save changes"
|
|
|
206 |
And I navigate to "View > User report" in the course gradebook
|
|
|
207 |
When I click on "Student 1" in the "user" search widget
|
|
|
208 |
And I set the field "View report as" to "User"
|
|
|
209 |
Then the following should exist in the "user-grade" table:
|
|
|
210 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
211 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % |
|
|
|
212 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % |
|
|
|
213 |
| Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - |
|
|
|
214 |
| Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % |
|
|
|
215 |
| Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % |
|
|
|
216 |
| Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - |
|
|
|
217 |
| Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % |
|
|
|
218 |
| Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % |
|
|
|
219 |
| Course total | - | 383.00 | 0–600 | 63.83 % | - |
|
|
|
220 |
And I log out
|
|
|
221 |
And I log in as "student1"
|
|
|
222 |
And I am on "C1" course homepage
|
|
|
223 |
And I navigate to "User report" in the course gradebook
|
|
|
224 |
Then the following should exist in the "user-grade" table:
|
|
|
225 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
226 |
| Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % |
|
|
|
227 |
| Test assignment two | 50.00 % | 35.00 | 0–100 | 35.00 % | 5.83 % |
|
|
|
228 |
| Sub category 1 total | 33.33 % | 115.00 | 0–200 | 57.50 % | - |
|
|
|
229 |
| Test assignment three | 50.00 % | 100.00 | 0–100 | 100.00 % | 16.67 % |
|
|
|
230 |
| Test assignment four | 50.00 % | 50.00 | 0–100 | 50.00 % | 8.33 % |
|
|
|
231 |
| Sub category 2 total | 33.33 % | 150.00 | 0–200 | 75.00 % | - |
|
|
|
232 |
| Test assignment five | 16.67 % | 21.00 | 0–100 | 21.00 % | 3.50 % |
|
|
|
233 |
| Test assignment six | 16.67 % | 97.00 | 0–100 | 97.00 % | 16.17 % |
|
|
|
234 |
| Course total | - | 383.00 | 0–600 | 63.83 % | - |
|