1 |
efrain |
1 |
@core @core_grades @gradereport_singleview @javascript
|
|
|
2 |
Feature: We can bulk insert grades for students in a course
|
|
|
3 |
As a teacher
|
|
|
4 |
In order to quickly grade items
|
|
|
5 |
I can bulk insert values for all or empty grades.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email | idnumber | alternatename |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 | fred |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com | s1 | james |
|
|
|
15 |
| student2 | Student | 2 | student1@example.com | s2 | holly |
|
|
|
16 |
| student3 | Student | 3 | student1@example.com | s3 | anna |
|
|
|
17 |
| student4 | Student | 4 | student1@example.com | s4 | zac |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
| user | course | role |
|
|
|
20 |
| teacher1 | C1 | editingteacher |
|
|
|
21 |
| student1 | C1 | student |
|
|
|
22 |
| student2 | C1 | student |
|
|
|
23 |
| student3 | C1 | student |
|
|
|
24 |
| student4 | C1 | student |
|
|
|
25 |
And the following "activities" exist:
|
|
|
26 |
| activity | course | idnumber | name | intro |
|
|
|
27 |
| assign | C1 | a1 | Test assignment one | Submit something! |
|
|
|
28 |
| assign | C1 | a2 | Test assignment two | Submit something! |
|
|
|
29 |
| assign | C1 | a3 | Test assignment three | Submit something! |
|
|
|
30 |
| assign | C1 | a4 | Test assignment four | Submit nothing! |
|
|
|
31 |
And I am on the "Course 1" "Course" page logged in as "teacher1"
|
|
|
32 |
And I turn editing mode on
|
|
|
33 |
|
|
|
34 |
Scenario: I can not save bulk insert until I fill required form elements
|
|
|
35 |
Given I navigate to "View > Grader report" in the course gradebook
|
|
|
36 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
37 |
And I choose "Single view for this item" in the open action menu
|
|
|
38 |
And I click on "Actions" "link"
|
|
|
39 |
When I click on "Bulk insert" "link"
|
|
|
40 |
And the "Empty grades" "radio" should be disabled
|
|
|
41 |
And the "All grades" "radio" should be disabled
|
|
|
42 |
And the "[name=bulkinsertmodal]" "css_element" should be disabled
|
|
|
43 |
And the "[data-action=save]" "css_element" should be disabled
|
|
|
44 |
And I click on "I understand that my unsaved changes will be lost." "checkbox"
|
|
|
45 |
And the "Empty grades" "radio" should be enabled
|
|
|
46 |
And the "All grades" "radio" should be enabled
|
|
|
47 |
And the "[name=bulkinsertmodal]" "css_element" should be enabled
|
|
|
48 |
And the "[data-action=save]" "css_element" should be disabled
|
|
|
49 |
And I click on "Empty grades" "radio"
|
|
|
50 |
And the "Empty grades" "radio" should be enabled
|
|
|
51 |
And the "All grades" "radio" should be enabled
|
|
|
52 |
And the "[name=bulkinsertmodal]" "css_element" should be enabled
|
|
|
53 |
Then the "[data-action=save]" "css_element" should be enabled
|
|
|
54 |
|
|
|
55 |
Scenario: I can bulk insert grades and check their override flags for grade view.
|
|
|
56 |
Given I am on the "Test assignment one" "assign activity" page
|
|
|
57 |
And I follow "View all submissions"
|
|
|
58 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
59 |
And I set the following fields to these values:
|
|
|
60 |
| Grade out of 100 | 50 |
|
|
|
61 |
And I press "Save changes"
|
|
|
62 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
63 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
64 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
65 |
And I choose "Single view for this item" in the open action menu
|
|
|
66 |
And the field "Grade for Student 1" matches value "50.00"
|
|
|
67 |
And the field "Override for Student 1" matches value "0"
|
|
|
68 |
And I click on "Actions" "link"
|
|
|
69 |
And I click on "Bulk insert" "link"
|
|
|
70 |
And I click on "I understand that my unsaved changes will be lost." "checkbox"
|
|
|
71 |
And I click on "Empty grades" "radio"
|
|
|
72 |
And I set the field "Insert new grade" to "1.0"
|
|
|
73 |
And I click on "Save" "button" in the ".modal-dialog" "css_element"
|
|
|
74 |
And the field "Grade for Student 1" matches value "50.00"
|
|
|
75 |
And the field "Override for Student 1" matches value "0"
|
|
|
76 |
And the field "Grade for Student 2" matches value "1.00"
|
|
|
77 |
And the field "Override for Student 2" matches value "1"
|
|
|
78 |
And the field "Grade for Student 3" matches value "1.00"
|
|
|
79 |
And the field "Override for Student 3" matches value "1"
|
|
|
80 |
And the field "Grade for Student 4" matches value "1.00"
|
|
|
81 |
And the field "Override for Student 4" matches value "1"
|
|
|
82 |
|
|
|
83 |
And I click on "Actions" "link"
|
|
|
84 |
When I click on "Bulk insert" "link"
|
|
|
85 |
And I click on "I understand that my unsaved changes will be lost." "checkbox"
|
|
|
86 |
And I click on "All grades" "radio"
|
|
|
87 |
And I set the field "Insert new grade" to "2.0"
|
|
|
88 |
And I click on "Save" "button" in the ".modal-dialog" "css_element"
|
|
|
89 |
And the field "Grade for Student 1" matches value "2.00"
|
|
|
90 |
And the field "Override for Student 1" matches value "1"
|
|
|
91 |
And the field "Grade for Student 2" matches value "2.00"
|
|
|
92 |
And the field "Override for Student 2" matches value "1"
|
|
|
93 |
And the field "Grade for Student 3" matches value "2.00"
|
|
|
94 |
And the field "Override for Student 3" matches value "1"
|
|
|
95 |
And the field "Grade for Student 4" matches value "2.00"
|
|
|
96 |
Then the field "Override for Student 4" matches value "1"
|
|
|
97 |
|
|
|
98 |
Scenario: I can bulk insert grades and check their override flags for user view.
|
|
|
99 |
Given I am on the "Test assignment two" "assign activity" page
|
|
|
100 |
And I follow "View all submissions"
|
|
|
101 |
And I click on "Grade" "link" in the "Student 1" "table_row"
|
|
|
102 |
And I set the following fields to these values:
|
|
|
103 |
| Grade out of 100 | 50 |
|
|
|
104 |
And I press "Save changes"
|
|
|
105 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
106 |
And I navigate to "View > Grader report" in the course gradebook
|
|
|
107 |
And I click on user menu "Student 1"
|
|
|
108 |
And I choose "Single view for this user" in the open action menu
|
|
|
109 |
And the field "Grade for Test assignment two" matches value "50.00"
|
|
|
110 |
And the field "Override for Test assignment two" matches value "0"
|
|
|
111 |
And I click on "Actions" "link"
|
|
|
112 |
When I click on "Bulk insert" "link"
|
|
|
113 |
And I click on "I understand that my unsaved changes will be lost." "checkbox"
|
|
|
114 |
And I click on "Empty grades" "radio"
|
|
|
115 |
And I set the field "Insert new grade" to "1.0"
|
|
|
116 |
And I click on "Save" "button" in the ".modal-dialog" "css_element"
|
|
|
117 |
And the field "Grade for Test assignment two" matches value "50.00"
|
|
|
118 |
And the field "Override for Test assignment two" matches value "0"
|
|
|
119 |
And the field "Grade for Test assignment one" matches value "1.00"
|
|
|
120 |
And the field "Override for Test assignment one" matches value "1"
|
|
|
121 |
And the field "Grade for Test assignment three" matches value "1.00"
|
|
|
122 |
And the field "Override for Test assignment three" matches value "1"
|
|
|
123 |
And the field "Grade for Test assignment four" matches value "1.00"
|
|
|
124 |
Then the field "Override for Test assignment four" matches value "1"
|
|
|
125 |
|
|
|
126 |
Scenario: I can not update grades if the value is out of bounds.
|
|
|
127 |
Given I navigate to "View > Grader report" in the course gradebook
|
|
|
128 |
And I click on grade item menu "Test assignment one" of type "gradeitem" on "grader" page
|
|
|
129 |
And I choose "Single view for this item" in the open action menu
|
|
|
130 |
And I click on "Actions" "link"
|
|
|
131 |
When I click on "Bulk insert" "link"
|
|
|
132 |
And I click on "I understand that my unsaved changes will be lost." "checkbox"
|
|
|
133 |
And I click on "Empty grades" "radio"
|
|
|
134 |
And I set the field "Insert new grade" to "-1"
|
|
|
135 |
And I click on "Save" "button" in the ".modal-dialog" "css_element"
|
|
|
136 |
And I should see "The grade entered for Test assignment one for Student 1 is less than the minimum allowed"
|
|
|
137 |
And I should see "The grade entered for Test assignment one for Student 2 is less than the minimum allowed"
|
|
|
138 |
And I should see "The grade entered for Test assignment one for Student 3 is less than the minimum allowed"
|
|
|
139 |
And I should see "The grade entered for Test assignment one for Student 4 is less than the minimum allowed"
|
|
|
140 |
Then I should see "Grades were set for 0 items"
|