/grade/tests/behat/grade_override_letter.feature

http://github.com/moodle/moodle · Gherkin Specification · 205 lines · 200 code · 5 blank · 0 comment · 1 complexity · f45c97ac8afe0569abd21921a8bbeee8 MD5 · raw file

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