2 Feature: Using the activity grade form element
3 In order to ensure validation is provided to the teacher
5 I need to know why I can not add/edit values in the form element
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 |
20 Scenario: Being able to change the grade type, scale and maximum grade when there are no grades
21 Given I log in as "admin"
22 And I navigate to "Scales" node in "Site administration > Grades"
23 And I press "Add a new scale"
24 And I set the following fields to these values:
26 | Scale | F,E,D,C,B,A |
27 And I press "Save changes"
28 And I press "Add a new scale"
29 And I set the following fields to these values:
30 | Name | Letter scale |
31 | Scale | Disappointing, Good, Very good, Excellent |
32 And I press "Save changes"
34 And I log in as "teacher1"
35 And I follow "Course 1"
36 And I turn editing mode on
37 And I add a "Forum" to section "1" and I fill the form with:
38 | Forum name | Test forum name |
39 | Forum type | Standard forum for general use |
40 | Description | Test forum description |
41 | Aggregate type | Average of ratings |
42 | scale[modgrade_type] | Point |
43 | scale[modgrade_point] | 100 |
44 | Group mode | No groups |
45 And I follow "Test forum name"
46 And I click on "Edit settings" "link" in the "Administration" "block"
47 When I expand all fieldsets
48 Then I should not see "Some grades have already been awarded, so the grade type"
49 And I set the field "scale[modgrade_type]" to "Scale"
50 And I set the field "scale[modgrade_scale]" to "ABCDEF"
51 And I press "Save and display"
52 And I should not see "You cannot change the type, as grades already exist for this item"
53 And I click on "Edit settings" "link" in the "Administration" "block"
54 And I expand all fieldsets
55 And I should not see "Some grades have already been awarded, so the grade type"
56 And I set the field "scale[modgrade_scale]" to "Letter scale"
57 And I press "Save and display"
58 And I should not see "You cannot change the scale, as grades already exist for this item"
59 And I click on "Edit settings" "link" in the "Administration" "block"
60 And I expand all fieldsets
61 And I should not see "Some grades have already been awarded, so the grade type"
62 And I set the field "scale[modgrade_type]" to "Point"
63 And I set the field "Maximum grade" to "50"
64 And I press "Save and display"
65 And I should not see "You must choose whether to rescale existing grades or not"
68 Scenario: Attempting to change the scale when grades already exist
69 Given I log in as "admin"
70 And I navigate to "Scales" node in "Site administration > Grades"
71 And I press "Add a new scale"
72 And I set the following fields to these values:
74 | Scale | F,E,D,C,B,A |
75 And I press "Save changes"
76 And I press "Add a new scale"
77 And I set the following fields to these values:
78 | Name | Letter scale |
79 | Scale | Disappointing, Good, Very good, Excellent |
80 And I press "Save changes"
82 And I log in as "teacher1"
83 And I follow "Course 1"
84 And I turn editing mode on
85 And I add a "Assignment" to section "1" and I fill the form with:
86 | Assignment name | Test assignment name |
87 | Description | Test assignment description |
88 | grade[modgrade_type] | Scale |
89 | grade[modgrade_scale] | ABCDEF |
90 And I follow "Course 1"
91 And I follow "Test assignment name"
92 And I follow "View all submissions"
93 And I click on "Grade" "link" in the "Student 1" "table_row"
94 And I set the field "Grade" to "C"
95 And I press "Save changes"
97 And I click on "Edit settings" "link"
98 When I expand all fieldsets
99 Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
101 Scenario: Attempting to change the maximum grade when ratings exist
102 Given I log in as "teacher1"
103 And I follow "Course 1"
104 And I turn editing mode on
105 And I add a "Forum" to section "1" and I fill the form with:
106 | Forum name | Test forum name |
107 | Forum type | Standard forum for general use |
108 | Description | Test forum description |
109 | Aggregate type | Average of ratings |
110 | scale[modgrade_type] | Point |
111 | scale[modgrade_point] | 100 |
112 | Group mode | No groups |
114 And I log in as "student1"
115 And I follow "Course 1"
116 And I follow "Test forum name"
117 And I press "Add a new discussion topic"
118 And I set the following fields to these values:
119 | Subject | Discussion subject |
120 | Message | Discussion message |
121 And I press "Post to forum"
123 And I log in as "teacher1"
124 And I follow "Course 1"
125 And I follow "Test forum name"
126 And I follow "Discussion subject"
127 And I set the field "rating" to "100"
129 And I click on "Edit settings" "link" in the "Administration" "block"
130 When I expand all fieldsets
131 Then I should see "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."
132 And I set the field "Maximum grade" to "50"
133 And I press "Save and display"
134 And I should see "You cannot change the maximum grade when grades already exist for an activity with ratings"
137 Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
138 Given I log in as "teacher1"
139 And I follow "Course 1"
140 And I turn editing mode on
141 And I add a "Assignment" to section "1" and I fill the form with:
142 | Assignment name | Test assignment name |
143 | Description | Test assignment description |
144 And I follow "Course 1"
145 And I follow "Test assignment name"
146 And I follow "View all submissions"
147 And I click on "Grade" "link" in the "Student 1" "table_row"
148 And I set the field "Grade out of 100" to "50"
149 And I press "Save changes"
151 And I click on "Edit settings" "link"
152 When I expand all fieldsets
153 Then I should see "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."