1 |
efrain |
1 |
@core_form
|
|
|
2 |
Feature: Using the activity grade form element
|
|
|
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 in the form element
|
|
|
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 "activities" exist:
|
|
|
24 |
| activity | course | section | name | intro | idnumber | type | groupmode |
|
|
|
25 |
| assign | C1 | 1 | Test assignment name | Test assignment description | | | |
|
|
|
26 |
| forum | C1 | 1 | Test forum name | | forum1 | general | 0 |
|
|
|
27 |
And the following "mod_forum > discussions" exist:
|
|
|
28 |
| user | forum | name | message |
|
|
|
29 |
| student1 | forum1 | Discussion subject | Discussion message |
|
|
|
30 |
|
|
|
31 |
@javascript
|
|
|
32 |
Scenario: Being able to change the grade type, scale and maximum grade when there are no grades
|
|
|
33 |
Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
|
|
|
34 |
And I set the following fields to these values:
|
|
|
35 |
| Ratings > Aggregate type | Average of ratings |
|
|
|
36 |
| id_scale_modgrade_type | Point |
|
|
|
37 |
| Ratings > scale[modgrade_point] | 60 |
|
|
|
38 |
And I press "Save and return to course"
|
|
|
39 |
And I am on the "Test forum name" "forum activity editing" page
|
|
|
40 |
When I expand all fieldsets
|
|
|
41 |
Then I should not see "Some grades have already been awarded, so the grade type"
|
|
|
42 |
And I set the field "id_scale_modgrade_type" to "Scale"
|
|
|
43 |
And I set the field "Ratings > scale[modgrade_scale]" to "ABCDEF"
|
|
|
44 |
And I press "Save and display"
|
|
|
45 |
And I should not see "You cannot change the type, as grades already exist for this item"
|
|
|
46 |
And I navigate to "Settings" in current page administration
|
|
|
47 |
And I expand all fieldsets
|
|
|
48 |
And I should not see "Some grades have already been awarded, so the grade type"
|
|
|
49 |
And I set the field "Ratings > scale[modgrade_scale]" to "Letter scale"
|
|
|
50 |
And I press "Save and display"
|
|
|
51 |
And I should not see "You cannot change the scale, as grades already exist for this item"
|
|
|
52 |
And I navigate to "Settings" in current page administration
|
|
|
53 |
And I expand all fieldsets
|
|
|
54 |
And I should not see "Some grades have already been awarded, so the grade type"
|
|
|
55 |
And I set the field "id_scale_modgrade_type" to "Point"
|
|
|
56 |
And I set the field "Ratings > Maximum grade" to "50"
|
|
|
57 |
And I press "Save and display"
|
|
|
58 |
And I should not see "You must choose whether to rescale existing grades or not"
|
|
|
59 |
|
|
|
60 |
@javascript
|
|
|
61 |
Scenario: Attempting to change the scale when grades already exist in rating activity
|
|
|
62 |
Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
|
|
|
63 |
And I set the following fields to these values:
|
|
|
64 |
| Ratings > Aggregate type | Average of ratings |
|
|
|
65 |
| id_scale_modgrade_type | Scale |
|
|
|
66 |
| Ratings > scale[modgrade_scale] | ABCDEF |
|
|
|
67 |
And I press "Save and display"
|
|
|
68 |
And I follow "Discussion subject"
|
|
|
69 |
And I set the field "rating" to "D"
|
|
|
70 |
And I am on the "Test forum name" "forum activity editing" page
|
|
|
71 |
When I expand all fieldsets
|
|
|
72 |
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
|
|
|
73 |
# Try saving the form and visiting it back to verify that everything is working ok.
|
|
|
74 |
And I press "Save and display"
|
|
|
75 |
And I should not see "When selecting a ratings aggregate type you must also select"
|
|
|
76 |
And I navigate to "Settings" in current page administration
|
|
|
77 |
And I expand all fieldsets
|
|
|
78 |
And the field "Ratings > Aggregate type" matches value "Average of ratings"
|
|
|
79 |
And the field "id_scale_modgrade_type" matches value "Scale"
|
|
|
80 |
And the field "Ratings > scale[modgrade_scale]" matches value "ABCDEF"
|
|
|
81 |
|
|
|
82 |
@javascript
|
|
|
83 |
Scenario: Attempting to change the scale when grades already exist in non-rating activity
|
|
|
84 |
Given I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
|
|
|
85 |
And I navigate to "Settings" in current page administration
|
|
|
86 |
And I set the following fields to these values:
|
|
|
87 |
| grade[modgrade_type] | Scale |
|
|
|
88 |
| grade[modgrade_scale] | ABCDEF |
|
|
|
89 |
And I press "Save and display"
|
|
|
90 |
And I am on the "Test assignment name" "assign activity" page
|
|
|
91 |
And I follow "View all submissions"
|
|
|
92 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
93 |
And I set the field "Grade" to "C"
|
|
|
94 |
And I press "Save changes"
|
|
|
95 |
And I follow "Edit settings"
|
|
|
96 |
When I expand all fieldsets
|
|
|
97 |
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
|
|
|
98 |
# Try saving the form and visiting it back to verify everything is working ok.
|
|
|
99 |
And I press "Save and display"
|
|
|
100 |
And I navigate to "Settings" in current page administration
|
|
|
101 |
And I expand all fieldsets
|
|
|
102 |
And the field "grade[modgrade_type]" matches value "Scale"
|
|
|
103 |
And the field "grade[modgrade_scale]" matches value "ABCDEF"
|
|
|
104 |
|
|
|
105 |
@javascript
|
|
|
106 |
Scenario: Attempting to change the maximum grade when ratings exist
|
|
|
107 |
Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1
|
|
|
108 |
And I set the following fields to these values:
|
|
|
109 |
| Ratings > Aggregate type | Average of ratings |
|
|
|
110 |
| id_scale_modgrade_type | Point |
|
|
|
111 |
| Ratings > scale[modgrade_point] | 100 |
|
|
|
112 |
And I press "Save and display"
|
|
|
113 |
And I follow "Discussion subject"
|
|
|
114 |
And I set the field "rating" to "100"
|
|
|
115 |
And I am on the "Test forum name" "forum activity editing" page
|
|
|
116 |
When I expand all fieldsets
|
|
|
117 |
Then I should see "You cannot change the type, as grades already exist for this item."
|
|
|
118 |
And the "Maximum grade" "field" should be disabled
|
|
|
119 |
|
|
|
120 |
@javascript
|
|
|
121 |
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
|
|
|
122 |
Given I am on the "Test assignment name" "assign activity" page logged in as teacher1
|
|
|
123 |
And I follow "View all submissions"
|
|
|
124 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
125 |
And I set the field "Grade out of 100" to "50"
|
|
|
126 |
And I press "Save changes"
|
|
|
127 |
And I follow "Edit settings"
|
|
|
128 |
When I expand all fieldsets
|
|
|
129 |
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."
|