MDL-49324 grades: Remove unnecessary @javascript tag from tests
[moodle.git] / grade / tests / behat / grade_override_letter.feature
CommitLineData
cb2cf2fe
SH
1@core @core_grades
2Feature: Grade letters can be overridden
3 In order to test the grade letters functionality
4 As a teacher I override site defaults
5 and alter the grade letters
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname |
10 | Course 1 | C1 |
11 And the following "users" exist:
12 | username | firstname | lastname | email | idnumber |
0fe86bbd 13 | teacher1 | Teacher | 1 | teacher1@example.com | t1 |
cb2cf2fe
SH
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "teacher1"
18 And I follow "Course 1"
4887d152 19 And I navigate to "Grades" node in "Course administration"
cb2cf2fe
SH
20 And I follow "Letters"
21 And I follow "Edit grade letters"
22
23 Scenario Outline: Grade letters can be completely overridden
24 When I set the following fields to these values:
25 | override | 1 |
26 | Grade letter 1 | <l1> |
27 | gradeboundary1 | <b1> |
28 | Grade letter 2 | <l2> |
29 | gradeboundary2 | <b2> |
30 | Grade letter 3 | <l3> |
31 | gradeboundary3 | <b3> |
32 | Grade letter 4 | <l4> |
33 | gradeboundary4 | <b4> |
34 | Grade letter 5 | <l5> |
35 | gradeboundary5 | <b5> |
36 | Grade letter 6 | <l6> |
37 | gradeboundary6 | <b6> |
38 | Grade letter 7 | <l7> |
39 | gradeboundary7 | <b7> |
40 | Grade letter 8 | <l8> |
41 | gradeboundary8 | <b8> |
42 | Grade letter 9 | <l9> |
43 | gradeboundary9 | <b9> |
44 | Grade letter 10 | |
45 | gradeboundary10 | |
46 | Grade letter 11 | |
47 | gradeboundary11 | |
48 | Grade letter 12 | |
49 | gradeboundary12 | |
50 | Grade letter 13 | |
51 | gradeboundary13 | |
52 | Grade letter 14 | |
53 | gradeboundary14 | |
54 And I press "Save changes"
55 Then I should see "The default grade letters are currently overridden."
56 And the following should exist in the "grade-letters-view" table:
57 | Highest | Lowest | Letter |
58 | <high1> | <low1> | <letter1> |
59 | <high2> | <low2> | <letter2> |
60 | <high3> | <low3> | <letter3> |
61 | <high4> | <low4> | <letter4> |
62 | <high5> | <low5> | <letter5> |
63 | <high6> | <low6> | <letter6> |
64
65 Examples:
66 | l1 | b1 | l2 | b2 | l3 | b3 | l4 | b4 | l5 | b5 | l6 | b6 | l7 | b7 | l8 | b8 | l9 | b9 | high1 | low1 | letter1 | high2 | low2 | letter2 | high3 | low3 | letter3 | high4 | low4 | letter4 | high5 | low5 | letter5 | high6 | low6 | letter6 |
67 | Z | 95 | Y | 85 | X | 75 | W | 65 | V | 55 | U | 45 | | | | | | | 100.00 % | 95.00 % | Z | 94.99 % | 85.00 % | Y | 84.99 % | 75.00 % | X | 74.99 % | 65.00 % | W | 64.99 % | 55.00 % | V | 54.99 % | 45.00 % | U |
68 | 5 | 100 | 4 | 80 | 3 | 60 | 2 | 40 | 1 | 20 | 0 | 0 | | | | | | | 100.00 % | 100.00 % | 5 | 99.99 % | 80.00 % | 4 | 79.99 % | 60.00 % | 3 | 59.99 % | 40.00 % | 2 | 39.99 % | 20.00 % | 1 | 19.99 % | 0.00 % | 0 |
69 | A | 95.25 | B | 76.75 | C | 50.01 | D | 40 | F | 0.01 | F- | 0 | | | | | | | 100.00 % | 95.25 % | A | 95.24 % | 76.75 % | B | 76.74 % | 50.01 % | C | 50.00 % | 40.00 % | D | 39.99 % | 0.01 % | F | 0.00 % | 0.00 % | F- |
70 | | | | | | | A | 95.25 | B | 76.75 | C | 50.01 | D | 40 | F | 0.01 | F- | 0 | 100.00 % | 95.25 % | A | 95.24 % | 76.75 % | B | 76.74 % | 50.01 % | C | 50.00 % | 40.00 % | D | 39.99 % | 0.01 % | F | 0.00 % | 0.00 % | F- |
71 | | | A | 95.25 | B | 76.75 | C | 50.01 | | | | | D | 40 | F | 0.01 | F- | 0 | 100.00 % | 95.25 % | A | 95.24 % | 76.75 % | B | 76.74 % | 50.01 % | C | 50.00 % | 40.00 % | D | 39.99 % | 0.01 % | F | 0.00 % | 0.00 % | F- |
72
73 Scenario: I delete a grade letter
74 Given I set the following fields to these values:
75 | override | 1 |
76 | Grade letter 1 | A |
77 | gradeboundary1 | 90 |
78 | Grade letter 2 | B |
79 | gradeboundary2 | 80 |
80 | Grade letter 3 | C |
81 | gradeboundary3 | 50 |
82 | Grade letter 4 | D |
83 | gradeboundary4 | 40 |
84 | Grade letter 5 | E |
85 | gradeboundary5 | 20 |
86 | Grade letter 6 | F |
87 | gradeboundary6 | 0 |
88 | Grade letter 7 | |
89 | gradeboundary7 | |
90 | Grade letter 8 | |
91 | gradeboundary8 | |
92 | Grade letter 9 | |
93 | gradeboundary9 | |
94 | Grade letter 10 | |
95 | gradeboundary10 | |
96 | Grade letter 11 | |
97 | gradeboundary11 | |
98 | Grade letter 12 | |
99 | gradeboundary12 | |
100 | Grade letter 13 | |
101 | gradeboundary13 | |
102 | Grade letter 14 | |
103 | gradeboundary14 | |
104 And I press "Save changes"
105 And I should see "The default grade letters are currently overridden."
106 And the following should exist in the "grade-letters-view" table:
107 | Highest | Lowest | Letter |
108 | 100.00 % | 90.00 % | A |
109 | 89.99 % | 80.00 % | B |
110 | 79.99 % | 50.00 % | C |
111 | 49.99 % | 40.00 % | D |
112 | 39.99 % | 20.00 % | E |
113 | 19.99 % | 0.00 % | F |
114 When I follow "Edit grade letters"
115 And I set the following fields to these values:
116 | override | 1 |
117 | Grade letter 1 | A |
118 | gradeboundary1 | 90 |
119 | Grade letter 2 | B |
120 | gradeboundary2 | 80 |
121 | Grade letter 3 | C |
122 | gradeboundary3 | 50 |
123 | Grade letter 4 | D |
124 | gradeboundary4 | 40 |
125 | Grade letter 5 | |
126 | gradeboundary5 | |
127 | Grade letter 6 | F |
128 | gradeboundary6 | 0 |
129 And I press "Save changes"
130 Then I should see "The default grade letters are currently overridden."
131 And the following should exist in the "grade-letters-view" table:
132 | Highest | Lowest | Letter |
133 | 100.00 % | 90.00 % | A |
134 | 89.99 % | 80.00 % | B |
135 | 79.99 % | 50.00 % | C |
136 | 49.99 % | 40.00 % | D |
137 | 39.99 % | 0.00 % | F |
138
139 Scenario: I override grade letters for a second time
140 Given I set the following fields to these values:
141 | override | 1 |
142 | Grade letter 1 | A+ |
143 | gradeboundary1 | 90 |
144 | Grade letter 2 | A |
145 | gradeboundary2 | 80 |
146 | Grade letter 3 | B+ |
147 | gradeboundary3 | 70 |
148 | Grade letter 4 | B |
149 | gradeboundary4 | 60 |
150 | Grade letter 5 | C |
151 | gradeboundary5 | 50 |
152 | Grade letter 6 | D |
153 | gradeboundary6 | 40 |
154 | Grade letter 7 | F |
155 | gradeboundary7 | 0 |
156 | Grade letter 8 | |
157 | gradeboundary8 | |
158 | Grade letter 9 | |
159 | gradeboundary9 | |
160 | Grade letter 10 | |
161 | gradeboundary10 | |
162 | Grade letter 11 | |
163 | gradeboundary11 | |
164 | Grade letter 12 | |
165 | gradeboundary12 | |
166 | Grade letter 13 | |
167 | gradeboundary13 | |
168 | Grade letter 14 | |
169 | gradeboundary14 | |
170 And I press "Save changes"
171 And I should see "The default grade letters are currently overridden."
172 And the following should exist in the "grade-letters-view" table:
173 | Highest | Lowest | Letter |
174 | 100.00 % | 90.00 % | A+ |
175 | 89.99 % | 80.00 % | A |
176 | 79.99 % | 70.00 % | B+ |
177 | 69.99 % | 60.00 % | B |
178 | 59.99 % | 50.00 % | C |
179 | 49.99 % | 40.00 % | D |
180 | 39.99 % | 0.00 % | F |
181 When I follow "Edit grade letters"
182 And I set the following fields to these values:
183 | override | 1 |
184 | Grade letter 1 | α |
185 | gradeboundary1 | 95 |
186 | Grade letter 2 | β |
187 | gradeboundary2 | 85 |
188 | Grade letter 3 | γ |
189 | gradeboundary3 | 70 |
190 | Grade letter 4 | δ |
191 | gradeboundary4 | 55 |
192 | Grade letter 5 | |
193 | gradeboundary5 | |
194 | Grade letter 6 | Ω |
195 | gradeboundary6 | 0 |
196 | Grade letter 7 | π |
197 | gradeboundary7 | 90 |
198 And I press "Save changes"
199 Then I should see "The default grade letters are currently overridden."
200 And the following should exist in the "grade-letters-view" table:
201 | Highest | Lowest | Letter |
202 | 100.00 % | 95.00 % | α |
203 | 94.99 % | 90.00 % | π |
204 | 89.99 % | 85.00 % | β |
205 | 84.99 % | 70.00 % | γ |
206 | 69.99 % | 55.00 % | δ |
47f084c6 207 | 54.99 % | 0.00 % | Ω |