1 |
efrain |
1 |
@core_grades @javascript
|
|
|
2 |
Feature: Editing a grade item
|
|
|
3 |
In order to ensure validation is provided to the teacher
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to know why I can not add/edit values on the grade category form
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| student1 | Student | 1 | student1@example.com |
|
|
|
11 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category | groupmode |
|
|
|
14 |
| Course 1 | C1 | 0 | 1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "scales" exist:
|
|
|
20 |
| name | scale |
|
|
|
21 |
| ABCDEF | F,E,D,C,B,A |
|
|
|
22 |
| Letter scale | Disappointing, Good, Very good, Excellent |
|
|
|
23 |
And the following "grade categories" exist:
|
|
|
24 |
| fullname | course | aggregation |
|
|
|
25 |
| Cat 1 | C1 | 6 |
|
|
|
26 |
And the following "grade items" exist:
|
|
|
27 |
| itemname | course | category |
|
|
|
28 |
| Item 1 | C1 | Cat 1 |
|
|
|
29 |
| Item 2 | C1 | Cat 1 |
|
|
|
30 |
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
|
|
|
31 |
|
|
|
32 |
Scenario: Being able to change the grade type, scale and maximum grade for a grade category when there are no overridden grades
|
|
|
33 |
Given I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
34 |
And I choose "Edit category" in the open action menu
|
|
|
35 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
36 |
Then I should not see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded"
|
|
|
37 |
And I expand all fieldsets
|
|
|
38 |
And I set the field "Grade type" to "Scale"
|
|
|
39 |
And I press "Save changes"
|
|
|
40 |
And I should see "Scale must be selected"
|
|
|
41 |
And I set the field "Scale" to "ABCDEF"
|
|
|
42 |
And I press "Save changes"
|
|
|
43 |
And I should not see "You cannot change the type, as grades already exist for this item"
|
|
|
44 |
And I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
45 |
And I choose "Edit category" in the open action menu
|
|
|
46 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
47 |
And I should not see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded"
|
|
|
48 |
And I expand all fieldsets
|
|
|
49 |
And I set the field "Scale" to "Letter scale"
|
|
|
50 |
And I press "Save changes"
|
|
|
51 |
And I should not see "You cannot change the scale, as grades already exist for this item"
|
|
|
52 |
|
|
|
53 |
Scenario: Attempting to change a category item's grade type when overridden grades already exist
|
|
|
54 |
Given I navigate to "View > Grader report" in the course gradebook
|
|
|
55 |
And I turn editing mode on
|
|
|
56 |
And I give the grade "20.00" to the user "Student 1" for the grade item "Cat 1 total"
|
|
|
57 |
And I press "Save changes"
|
|
|
58 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
59 |
And I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
60 |
And I choose "Edit category" in the open action menu
|
|
|
61 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
62 |
And I expand all fieldsets
|
|
|
63 |
Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
|
|
|
64 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'Value')]" "xpath_element" should exist
|
|
|
65 |
|
|
|
66 |
Scenario: Attempting to change a category item's scale when overridden grades already exist
|
|
|
67 |
Given I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
68 |
And I choose "Edit category" in the open action menu
|
|
|
69 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
70 |
And I expand all fieldsets
|
|
|
71 |
And I set the field "Grade type" to "Scale"
|
|
|
72 |
And I set the field "Scale" to "ABCDEF"
|
|
|
73 |
And I press "Save changes"
|
|
|
74 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
75 |
And I turn editing mode on
|
|
|
76 |
And I give the grade "C" to the user "Student 1" for the grade item "Cat 1 total"
|
|
|
77 |
And I press "Save changes"
|
|
|
78 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
79 |
And I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
80 |
And I choose "Edit category" in the open action menu
|
|
|
81 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
82 |
And I expand all fieldsets
|
|
|
83 |
Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type and scale cannot be changed."
|
|
|
84 |
And "//div[contains(concat(' ', normalize-space(@class), ' '), 'felement') and contains(text(), 'ABCDEF')]" "xpath_element" should exist
|
|
|
85 |
|
|
|
86 |
Scenario: Attempting to change a category item's maximum grade when no rescaling option has been chosen
|
|
|
87 |
Given I navigate to "View > Grader report" in the course gradebook
|
|
|
88 |
And I turn editing mode on
|
|
|
89 |
And I give the grade "20.00" to the user "Student 1" for the grade item "Cat 1 total"
|
|
|
90 |
And I press "Save changes"
|
|
|
91 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
92 |
And I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
93 |
And I choose "Edit category" in the open action menu
|
|
|
94 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
95 |
And I expand all fieldsets
|
|
|
96 |
Then I should see "This category has associated grade items which have been overridden. Therefore some grades have already been awarded, so the grade type cannot be changed. If you wish to change the maximum grade, you must first choose whether or not to rescale existing grades."
|
|
|
97 |
And I should see "Choose" in the "Rescale overridden grades" "field"
|
|
|
98 |
And the "Maximum grade" "field" should be disabled
|
|
|
99 |
|
|
|
100 |
Scenario: Perform changes to a grade category with custom decimal separator
|
|
|
101 |
Given the following "language customisations" exist:
|
|
|
102 |
| component | stringid | value |
|
|
|
103 |
| core_langconfig | decsep | # |
|
|
|
104 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
105 |
And I turn editing mode on
|
|
|
106 |
And I give the grade "20#00" to the user "Student 1" for the grade item "Cat 1 total"
|
|
|
107 |
And I press "Save changes"
|
|
|
108 |
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
|
|
109 |
And I click on grade item menu "Cat 1" of type "category" on "setup" page
|
|
|
110 |
And I choose "Edit category" in the open action menu
|
|
|
111 |
And I click on "Show more..." "link" in the ".modal-dialog" "css_element"
|
|
|
112 |
And I expand all fieldsets
|
|
|
113 |
And I set the field "Rescale overridden grades" to "Yes"
|
|
|
114 |
And I set the field "Maximum grade" to "87#50"
|
|
|
115 |
When I press "Save changes"
|
|
|
116 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
117 |
And I click on user menu "Student 1"
|
|
|
118 |
And I choose "Single view for this user" in the open action menu
|
|
|
119 |
Then I should see "Student 1"
|
|
|
120 |
And the field "Grade for Category total" matches value "17#50"
|