1 |
efrain |
1 |
@core @core_grades @javascript
|
|
|
2 |
Feature: Average grades are displayed in the gradebook
|
|
|
3 |
In order to check the expected results are displayed
|
|
|
4 |
As an admin
|
|
|
5 |
I need to assign grades and check that they display correctly in the gradebook.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | format |
|
|
|
10 |
| Course 1 | C1 | topics |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
# Teacher 1 is user without preferences set, Teacher 2 is user with preferences set
|
|
|
13 |
| username | firstname | lastname | email |
|
|
|
14 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
15 |
| teacher2 | Teacher | 2 | teacher2@example.com |
|
|
|
16 |
| student1 | Student | 1 | student1@example.com |
|
|
|
17 |
| student2 | Student | 2 | student2@example.com |
|
|
|
18 |
| student3 | Student | 3 | student3@example.com |
|
|
|
19 |
| student4 | Student | 4 | student4@example.com |
|
|
|
20 |
| student5 | Student | 5 | student5@example.com |
|
|
|
21 |
And the following "course enrolments" exist:
|
|
|
22 |
| user | course | role |
|
|
|
23 |
| teacher1 | C1 | editingteacher |
|
|
|
24 |
| teacher2 | C1 | editingteacher |
|
|
|
25 |
| student1 | C1 | student |
|
|
|
26 |
| student2 | C1 | student |
|
|
|
27 |
| student3 | C1 | student |
|
|
|
28 |
| student4 | C1 | student |
|
|
|
29 |
| student5 | C1 | student |
|
|
|
30 |
And the following "grade item" exists:
|
|
|
31 |
| course | C1 |
|
|
|
32 |
| itemname | Manual item 1 |
|
|
|
33 |
And the following "grade grades" exist:
|
|
|
34 |
| gradeitem | user | grade | hidden |
|
|
|
35 |
| Manual item 1 | student1 | 10.00 | 0 |
|
|
|
36 |
| Manual item 1 | student2 | 20.00 | 0 |
|
|
|
37 |
| Manual item 1 | student3 | 30.00 | 0 |
|
|
|
38 |
| Manual item 1 | student4 | 40.00 | 1 |
|
|
|
39 |
| Manual item 1 | student5 | 50.00 | 0 |
|
|
|
40 |
And the following "course enrolments" exist:
|
|
|
41 |
| user | course | role | status |
|
|
|
42 |
| student2 | C1 | student | suspended |
|
|
|
43 |
And I log in as "admin"
|
|
|
44 |
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
|
|
45 |
And I press "Delete" action in the "Student 5" report row
|
|
|
46 |
And I click on "Delete" "button" in the "Delete user" "dialogue"
|
|
|
47 |
# Enable averages
|
|
|
48 |
And I am on the "Course 1" "grades > course grade settings" page
|
|
|
49 |
And I set the following fields to these values:
|
|
|
50 |
| Show average | Show |
|
|
|
51 |
And I press "Save changes"
|
|
|
52 |
|
|
|
53 |
Scenario: Grade averages display correctly in the gradebook according to various settings
|
|
|
54 |
# Check the admin grade table
|
|
|
55 |
Given I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
56 |
# Average is (10 + 30 + 40)/3 = 26.67 for manual and total since hidden items are included on grader report
|
|
|
57 |
And the following should exist in the "user-grades" table:
|
|
|
58 |
| -1- | -2- | -3- |
|
|
|
59 |
| Overall average | 26.67 | 26.67 |
|
|
|
60 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
61 |
# Average is (10 + 20 + 30)/3 = 30.00 for manual since
|
|
|
62 |
# 1. Hidden items are NOT included on grader report.
|
|
|
63 |
# 2. There is a bug when we have suspended users in the course so here Student 2 is included.
|
|
|
64 |
# So the average is not write when preference is either not set or set to 0.
|
|
|
65 |
# Possibly this should be changed later to match grader report.
|
|
|
66 |
And I should see "30.00" in the "Manual item 1" "table_row"
|
|
|
67 |
|
|
|
68 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2"
|
|
|
69 |
And the following "user preferences" exist:
|
|
|
70 |
| user | preference | value |
|
|
|
71 |
| teacher2 | grade_report_showonlyactiveenrol | 1 |
|
|
|
72 |
And I am on the "Course 1" "grades > Grader report > View" page
|
|
|
73 |
And the following should exist in the "user-grades" table:
|
|
|
74 |
| -1- | -2- | -3- |
|
|
|
75 |
| Overall average | 26.67 | 26.67 |
|
|
|
76 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
77 |
# Average is (10 + 30)/2 = 20.00 for manual (when preference is set to 1 set average is correct).
|
|
|
78 |
And I should see "20.00" in the "Manual item 1" "table_row"
|
|
|
79 |
And the following "user preferences" exist:
|
|
|
80 |
| user | preference | value |
|
|
|
81 |
| teacher2 | grade_report_showonlyactiveenrol | 0 |
|
|
|
82 |
And I am on the "Course 1" "grades > Grader report > View" page
|
|
|
83 |
And the following should exist in the "user-grades" table:
|
|
|
84 |
| -1- | -2- | -3- |
|
|
|
85 |
| Overall average | 25.00 | 25.00 |
|
|
|
86 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
87 |
# Average is (10 + 30)/2 = 20.00 for manual (when preference is set to 0 set average is NOT correct).
|
|
|
88 |
And I should see "20.00" in the "Manual item 1" "table_row"
|
|
|
89 |
|
|
|
90 |
# Check the user grade table
|
|
|
91 |
When I am on the "Course 1" "grades > user > View" page logged in as "student1"
|
|
|
92 |
# Average of manual item is (10 + 30)/2 = 20.00 since hidden items are not included on user report.
|
|
|
93 |
# But total is calculated and its settings allow using hidden grades so it will stay the same.
|
|
|
94 |
Then the following should exist in the "user-grade" table:
|
|
|
95 |
| Grade item | Calculated weight | Grade | Range | Percentage | Average | Contribution to course total |
|
|
|
96 |
| Manual item 1 | 100.00 % | 10.00 | 0–100 | 10.00 % | 20.00 | 10.00 % |
|
|
|
97 |
| Course total | - | 10.00 | 0–100 | 10.00 % | 26.67 | - |
|
|
|
98 |
|
|
|
99 |
# Default grade_report_showonlyactiveenrol is 1 so change that
|
|
|
100 |
And the following config values are set as admin:
|
|
|
101 |
| grade_report_showonlyactiveenrol | 0 |
|
|
|
102 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2"
|
|
|
103 |
And the following should exist in the "user-grades" table:
|
|
|
104 |
| -1- | -2- | -3- |
|
|
|
105 |
| Overall average | 25.00 | 25.00 |
|
|
|
106 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
107 |
And I should see "20.00" in the "Manual item 1" "table_row"
|
|
|
108 |
And the following "user preferences" exist:
|
|
|
109 |
| user | preference | value |
|
|
|
110 |
| teacher2 | grade_report_showonlyactiveenrol | 1 |
|
|
|
111 |
And I am on the "Course 1" "grades > Grader report > View" page
|
|
|
112 |
And the following should exist in the "user-grades" table:
|
|
|
113 |
| -1- | -2- | -3- |
|
|
|
114 |
| Overall average | 26.67 | 26.67 |
|
|
|
115 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
116 |
And I should see "20.00" in the "Manual item 1" "table_row"
|
|
|
117 |
|
|
|
118 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
119 |
And the following should exist in the "user-grades" table:
|
|
|
120 |
| -1- | -2- | -3- |
|
|
|
121 |
| Overall average | 25.00 | 25.00 |
|
|
|
122 |
And I am on the "Course 1" "grades > Grade summary > View" page
|
|
|
123 |
And I should see "20.00" in the "Manual item 1" "table_row"
|
|
|
124 |
|
|
|
125 |
And I am on the "Course 1" "grades > user > View" page logged in as "student1"
|
|
|
126 |
And the following should exist in the "user-grade" table:
|
|
|
127 |
| Grade item | Calculated weight | Grade | Range | Percentage | Average | Contribution to course total |
|
|
|
128 |
| Manual item 1 | 100.00 % | 10.00 | 0–100 | 10.00 % | 20.00 | 10.00 % |
|
|
|
129 |
| Course total | - | 10.00 | 0–100 | 10.00 % | 26.67 | - |
|