2 Feature: We can enter in grades and view reports from the gradebook
3 In order to check the expected results are displayed
5 I need to assign grades and check that they display correctly in the gradebook.
6 I need to enable grade weightings and check that they are displayed correctly.
9 Given the following "courses" exist:
10 | fullname | shortname | format |
11 | Course 1 | C1 | topics |
12 And the following "users" exist:
13 | username | firstname | lastname | email |
14 | teacher1 | Teacher | 1 | teacher1@asd.com |
15 | student1 | Student | 1 | student1@asd.com |
16 And the following "course enrolments" exist:
17 | user | course | role |
18 | teacher1 | C1 | editingteacher |
19 | student1 | C1 | student |
20 And I log in as "admin"
21 And I set the following administration settings values:
22 | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
24 And I log in as "teacher1"
25 And I follow "Course 1"
26 And I turn editing mode on
27 And I add a "Assignment" to section "1" and I fill the form with:
28 | Assignment name | Test assignment name 1 |
29 | Description | Submit your online text |
30 | assignsubmission_onlinetext_enabled | 1 |
31 And I add a "Assignment" to section "1" and I fill the form with:
32 | Assignment name | Test assignment name 2 |
33 | Description | Submit your online text |
34 | assignsubmission_onlinetext_enabled | 1 |
36 And I log in as "student1"
37 And I follow "Course 1"
38 And I follow "Test assignment name 1"
39 When I press "Add submission"
40 And I set the following fields to these values:
41 | Online text | This is a submission for assignment 1 |
42 And I press "Save changes"
43 Then I should see "Submitted for grading"
44 And I follow "Course 1"
45 And I follow "Test assignment name 2"
46 When I press "Add submission"
47 And I set the following fields to these values:
48 | Online text | This is a submission for assignment 2 |
49 And I press "Save changes"
50 Then I should see "Submitted for grading"
52 And I log in as "teacher1"
53 And I follow "Course 1"
55 And I turn editing mode on
56 And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1"
57 And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
58 And I press "Save changes"
61 Scenario: Grade a grade item and ensure the results display correctly in the gradebook
62 When I set the field "Grade report" to "User report"
63 And the "Grade report" select box should contain "Grader report"
64 And the "Grade report" select box should contain "Outcomes report"
65 And the "Grade report" select box should contain "User report"
66 And the "Select all or one user" select box should contain "All users (1)"
68 And I log in as "student1"
69 And I follow "Course 1"
71 Then the following should exist in the "user-grade" table:
72 | Grade item | Grade | Range | Percentage |
73 | Test assignment name 1 | 80.00 | 0–100 | 80.00 % |
74 | Test assignment name 2 | 90.00 | 0–100 | 90.00 % |
75 | Course totalSimple weighted mean of grades. | 85.00 | 0–100 | 85.00 % |
76 And the following should not exist in the "user-grade" table:
77 | Grade item | Grade | Range | Percentage |
78 | Course total | 90.00 | 0–110 | 90.00 % |
79 And I set the field "Grade report" to "Overview report"
80 And "C1" row "Grade" column of "overview-grade" table should contain "85.00"
81 And "C1" row "Grade" column of "overview-grade" table should not contain "90.00"
84 Scenario: We can add a weighting to a grade item and it is displayed properly in the user report
85 When I set the field "Grade report" to "Set up grades layout"
86 And I set the following settings for grade item "Course 1":
87 | Aggregation | Weighted mean of grades |
88 And I set the field "Extra credit value for Test assignment name" to "0.72"
89 And I press "Save changes"
90 And I set the field "Grade report" to "User report"
91 And I navigate to "Course grade settings" node in "Grade administration > Settings"
92 And I set the following fields to these values:
93 | Show weightings | Show |
94 And I press "Save changes"
96 And I log in as "student1"
97 And I follow "Course 1"
99 Then the following should exist in the "user-grade" table:
100 | Grade item | Calculated weight | Grade | Range | Percentage |
101 | Test assignment name 1 | 41.86 % | 80.00 | 0–100 | 80.00 % |
102 | Test assignment name 2 | 58.14 % | 90.00 | 0–100 | 90.00 % |
103 | Course totalWeighted mean of grades. | - | 85.81 | 0–100 | 85.81 % |
104 And the following should not exist in the "user-grade" table:
105 | Grade item | Calculated weight | Percentage |
106 | Test assignment name 1 | 0.72% | 0.72% |
107 | Test assignment name 2 | 1.00% | 1.00% |
108 | Course total | 1.00% | 1.00% |