MDL-47543 core_grades: improve navigation menu in grade administration
[moodle.git] / grade / tests / behat / grade_scales.feature
CommitLineData
ebfcb9eb
MG
1@core @core_grades
2Feature: View gradebook when scales are used
3 In order to use scales to grade activities
4 As an teacher
5 I need to be able to view gradebook with scales
6
7 Background:
8 Given I log in as "admin"
9 And I set the following administration settings values:
10 | grade_report_showranges | 1 |
837b9289 11 | 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 |
ebfcb9eb
MG
12 And I navigate to "Scales" node in "Site administration > Grades"
13 And I press "Add a new scale"
14 And I set the following fields to these values:
15 | Name | Letterscale |
16 | Scale | F,D,C,B,A |
17 And I press "Save changes"
18 And I log out
19 And the following "courses" exist:
20 | fullname | shortname |
21 | Course 1 | C1 |
22 And the following "users" exist:
23 | username | firstname | lastname | email | idnumber |
24 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 |
25 | student1 | Student | 1 | student1@asd.com | s1 |
26 | student2 | Student | 2 | student2@asd.com | s2 |
27 | student3 | Student | 3 | student3@asd.com | s3 |
28 | student4 | Student | 4 | student4@asd.com | s4 |
29 | student5 | Student | 5 | student5@asd.com | s5 |
30 And the following "course enrolments" exist:
31 | user | course | role |
32 | teacher1 | C1 | editingteacher |
33 | student1 | C1 | student |
34 | student2 | C1 | student |
35 | student3 | C1 | student |
36 | student4 | C1 | student |
37 | student5 | C1 | student |
38 And the following "grade categories" exist:
39 | fullname | course |
40 | Sub category 1 | C1 |
41 And the following "activities" exist:
42 | activity | course | idnumber | name | intro | gradecategory |
43 | assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 |
44 And I log in as "teacher1"
45 And I follow "Course 1"
46 And I follow "Test assignment one"
47 And I follow "Edit settings"
48 And I expand all fieldsets
49 And I set the field "grade[modgrade_type]" to "Scale"
50 And I set the field "grade[modgrade_scale]" to "Letterscale"
51 And I press "Save and display"
52 And I follow "View/grade all submissions"
53 And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
54 And I set the field "Grade" to "A"
55 And I press "Save and show next"
56 And I set the field "Grade" to "B"
57 And I press "Save and show next"
58 And I set the field "Grade" to "C"
59 And I press "Save and show next"
60 And I set the field "Grade" to "D"
61 And I press "Save and show next"
62 And I set the field "Grade" to "F"
63 And I press "Save changes"
64 And I follow "Course 1"
65 And I follow "Grades"
66 And I turn editing mode on
67
68 @javascript
837b9289
MG
69 Scenario: Test displaying scales in gradebook in aggregation method Natural
70 When I turn editing mode off
ebfcb9eb
MG
71 Then the following should exist in the "user-grades" table:
72 | -1- | -4- | -5- | -6- |
73 | Student 1 | A | 5.00 | 5.00 |
74 | Student 2 | B | 4.00 | 4.00 |
75 | Student 3 | C | 3.00 | 3.00 |
76 | Student 4 | D | 2.00 | 2.00 |
77 | Student 5 | F | 1.00 | 1.00 |
78 And the following should exist in the "user-grades" table:
79 | -1- | -2- | -3- | -4- |
80 | Range | F–A | 0.00–5.00 | 0.00–5.00 |
81 | Overall average | C | 3.00 | 3.00 |
82 And I follow "User report"
83 And I set the field "Select all or one user" to "Student 3"
84 And I click on "Select all or one user" "select"
85 And the following should exist in the "user-grade" table:
86 | Grade item | Grade | Range | Percentage |
87 | Test assignment one | C | F–A | 50.00 % |
837b9289
MG
88 | Category totalNatural. | 3.00 | 0–5 | 60.00 % |
89 | Course totalNatural. | 3.00 | 0–5 | 60.00 % |
90 And I set the field "jump" to "Set up grades layout"
ebfcb9eb
MG
91 And the following should exist in the "grade_edit_tree_table" table:
92 | Name | Max grade |
93 | Test assignment one | 5.00 |
94 | Category total | 5.00 |
95 | Course total | 5.00 |
96 And I log out
97 And I log in as "student2"
98 And I follow "Course 1"
99 And I follow "Grades"
100 And the following should exist in the "user-grade" table:
101 | Grade item | Grade | Range | Percentage |
102 | Test assignment one | B | F–A | 75.00 % |
837b9289
MG
103 | Category totalNatural. | 4.00 | 0–5 | 80.00 % |
104 | Course totalNatural. | 4.00 | 0–5 | 80.00 % |
ebfcb9eb
MG
105
106 @javascript
107 Scenario Outline: Test displaying scales in gradebook in all other aggregation methods
108 When I follow "Edit Course 1"
109 And I set the field "Aggregation" to "<aggregation>"
110 And I press "Save changes"
111 And I follow "Edit Sub category 1"
112 And I expand all fieldsets
113 And I set the field "Aggregation" to "<aggregation>"
114 And I set the field "Category name" to "Sub category (<aggregation>)"
115 And I set the field "Maximum grade" to "5"
116 And I set the field "Minimum grade" to "1"
117 And I press "Save changes"
118 And I turn editing mode off
119 Then the following should exist in the "user-grades" table:
120 | -1- | -4- | -5- | -6- |
121 | Student 1 | A | 5.00 | <coursetotal1> |
122 | Student 2 | B | 4.00 | <coursetotal2> |
123 | Student 3 | C | 3.00 | <coursetotal3> |
124 | Student 4 | D | 2.00 | <coursetotal4> |
125 | Student 5 | F | 1.00 | <coursetotal5> |
126 And the following should exist in the "user-grades" table:
127 | -1- | -2- | -3- | -4- |
128 | Range | F–A | 1.00–5.00 | 0.00–100.00 |
129 | Overall average | C | 3.00 | <overallavg> |
130 And I follow "User report"
131 And I set the field "Select all or one user" to "Student 3"
132 And I click on "Select all or one user" "select"
133 And the following should exist in the "user-grade" table:
134 | Grade item | Grade | Range | Percentage |
135 | Test assignment one | C | F–A | 50.00 % |
837b9289
MG
136 | Category total<aggregation>. | 3.00 | 1–5 | 50.00 % |
137 | Course total<aggregation>. | <coursetotal3> | 0–100 | <courseperc3> |
138 And I set the field "jump" to "Set up grades layout"
ebfcb9eb
MG
139 And the following should exist in the "grade_edit_tree_table" table:
140 | Name | Max grade |
141 | Test assignment one | A (5) |
142 | Category total | |
143 | Course total | |
144 And I log out
145 And I log in as "student2"
146 And I follow "Course 1"
147 And I follow "Grades"
148 And the following should exist in the "user-grade" table:
149 | Grade item | Grade | Range | Percentage |
150 | Test assignment one | B | F–A | 75.00 % |
837b9289
MG
151 | Category total<aggregation>. | 4.00 | 1–5 | 75.00 % |
152 | Course total<aggregation>. | <coursetotal2> | 0–100 | <courseperc2> |
ebfcb9eb
MG
153
154 Examples:
155 | aggregation | coursetotal1 | coursetotal2 | coursetotal3 | coursetotal4 | coursetotal5 |overallavg | courseperc2 | courseperc3 |
156 | Mean of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
157 | Weighted mean of grades | - | - | - | - | - | - | - | - |
158 | Simple weighted mean of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
159 | Mean of grades (with extra credits) | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
160 | Median of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
161 | Lowest grade | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
162 | Highest grade | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
163 | Mode of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |