MDL-49324 grades: Remove unnecessary @javascript tag from tests
[moodle.git] / grade / report / singleview / tests / behat / bulk_insert_grades.feature
CommitLineData
56913501
DC
1@core @core_grades @gradereport_singleview
2Feature: 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 |
0fe86bbd
RT
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 |
56913501
DC
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
56913501
DC
32 Scenario: I can bulk insert grades and check their override flags for grade view.
33 Given I log in as "teacher1"
34 And I follow "Course 1"
35 And I follow "Test assignment one"
36 And I follow "View/grade all submissions"
37 And I follow "Grade Student 1"
38 And I set the following fields to these values:
39 | Grade out of 100 | 50 |
40 And I press "Save changes"
41 And I press "Continue"
42 And I follow "View gradebook"
43 And I follow "Single view for Test assignment one"
44 Then the field "Grade for james (Student) 1" matches value "50.00"
45 And the field "Override for james (Student) 1" matches value "0"
47f084c6 46 And I set the field "Perform bulk insert" to "1"
56913501
DC
47 And I set the field "Insert value" to "1.0"
48 And I press "Save"
49 And I press "Continue"
50 And the field "Grade for james (Student) 1" matches value "50.00"
51 And the field "Override for james (Student) 1" matches value "0"
52 And the field "Grade for holly (Student) 2" matches value "1.00"
53 And the field "Override for holly (Student) 2" matches value "1"
54 And the field "Grade for anna (Student) 3" matches value "1.00"
55 And the field "Override for anna (Student) 3" matches value "1"
56 And the field "Grade for zac (Student) 4" matches value "1.00"
57 And the field "Override for zac (Student) 4" matches value "1"
47f084c6
AN
58 And I set the field "For" to "All grades"
59 And I set the field "Perform bulk insert" to "1"
56913501
DC
60 And I set the field "Insert value" to "2.0"
61 And I press "Save"
62 And I press "Continue"
63 And the field "Grade for james (Student) 1" matches value "2.00"
64 And the field "Override for james (Student) 1" matches value "1"
65 And the field "Grade for holly (Student) 2" matches value "2.00"
66 And the field "Override for holly (Student) 2" matches value "1"
67 And the field "Grade for anna (Student) 3" matches value "2.00"
68 And the field "Override for anna (Student) 3" matches value "1"
69 And the field "Grade for zac (Student) 4" matches value "2.00"
70 And the field "Override for zac (Student) 4" matches value "1"
71
56913501
DC
72 Scenario: I can bulk insert grades and check their override flags for user view.
73 Given I log in as "teacher1"
74 And I follow "Course 1"
75 And I follow "Test assignment two"
76 And I follow "View/grade all submissions"
77 And I follow "Grade Student 1"
78 And I set the following fields to these values:
79 | Grade out of 100 | 50 |
80 And I press "Save changes"
81 And I press "Continue"
82 And I follow "View gradebook"
83 And I follow "Single view for Test assignment two"
47f084c6 84 And I select "Student 1" from the "Select user..." singleselect
56913501
DC
85 Then the field "Grade for Test assignment two" matches value "50.00"
86 And the field "Override for Test assignment two" matches value "0"
47f084c6
AN
87 And I set the field "For" to "Empty grades"
88 And I set the field "Perform bulk insert" to "1"
56913501
DC
89 And I set the field "Insert value" to "1.0"
90 And I press "Save"
91 And I press "Continue"
92 And the field "Grade for Test assignment two" matches value "50.00"
93 And the field "Override for Test assignment two" matches value "0"
94 And the field "Grade for Test assignment one" matches value "1.00"
95 And the field "Override for Test assignment one" matches value "1"
96 And the field "Grade for Test assignment three" matches value "1.00"
97 And the field "Override for Test assignment three" matches value "1"
98 And the field "Grade for Test assignment four" matches value "1.00"
99 And the field "Override for Test assignment four" matches value "1"