1 |
efrain |
1 |
@core @core_grades @javascript
|
|
|
2 |
Feature: Student and teacher's view of aggregated grade items is consistent when hidden grade items are present
|
|
|
3 |
In order to calculate grade totals
|
|
|
4 |
As an teacher
|
|
|
5 |
I need to add aggregate columns to the gradebook
|
|
|
6 |
|
|
|
7 |
Scenario: Natural aggregation of course categories with hidden items calculates correctly for teacher and student
|
|
|
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 |
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 |
|
|
|
25 |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 | 100 |
|
|
|
26 |
| assign | C1 | a2 | Test assignment two | Submit something! | Sub category 1 | 100 |
|
|
|
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 I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
|
|
|
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 | calculated |
|
|
|
33 |
And I click on "Save" "button" in the "New grade item" "dialogue"
|
|
|
34 |
And I set "=[[a4]]/2" calculation for grade item "calculated" with idnumbers:
|
|
|
35 |
| Sub category 1 | sub1 |
|
|
|
36 |
And I navigate to "Grades > Report settings > Overview report" in site administration
|
|
|
37 |
And I set the field "s__grade_report_overview_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
|
|
38 |
And I navigate to "Grades > Report settings > User report" in site administration
|
|
|
39 |
And I set the field "s__grade_report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
|
|
|
40 |
And I press "Save changes"
|
|
|
41 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
|
|
|
42 |
And I turn editing mode on
|
|
|
43 |
And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment one"
|
|
|
44 |
And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment three"
|
|
|
45 |
And I press "Save changes"
|
|
|
46 |
And I set the following settings for grade item "Test assignment four" of type "gradeitem" on "grader" page:
|
|
|
47 |
| Hidden | 1 |
|
|
|
48 |
And I am on the "Course 1" "grades > User report > View" page
|
|
|
49 |
And I click on "Student 1" in the "user" search widget
|
|
|
50 |
And I set the field "View report as" to "Myself"
|
|
|
51 |
Then the following should exist in the "user-grade" table:
|
|
|
52 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
53 |
| Test assignment one | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % |
|
|
|
54 |
| Test assignment two | 0.00 %( Empty ) | - | 0–100 | - | 0.00 % |
|
|
|
55 |
| Test assignment three | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % |
|
|
|
56 |
| Course total | - | 100.00 | 0–200 | 50.00 % | - |
|
|
|
57 |
When I am on the "Course 1" "grades > User report > View" page logged in as "student1"
|
|
|
58 |
Then the following should exist in the "user-grade" table:
|
|
|
59 |
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
|
|
|
60 |
| Test assignment one | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % |
|
|
|
61 |
| Test assignment two | -( Empty ) | - | 0–100 | - | - |
|
|
|
62 |
| Test assignment three | 100.00 % | 50.00 | 0–100 | 50.00 % | 25.00 % |
|
|
|
63 |
| Course total | - | 100.00 | 0–200 | 50.00 % | - |
|
|
|
64 |
And I should not see "Test assignment four" in the "user-grade" "table"
|