MDL-51709 gradebook: Name display in single view.
[moodle.git] / grade / report / singleview / tests / behat / bulk_insert_grades.feature
CommitLineData
821ab1bf 1@core @core_grades @gradereport_singleview @javascript
56913501
DC
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"
fdeeaff9 34 And I am on "Course 1" course homepage
56913501 35 And I follow "Test assignment one"
9bad658a 36 And I navigate to "View all submissions" in current page administration
821ab1bf 37 And I click on "Grade" "link" in the "Student 1" "table_row"
56913501
DC
38 And I set the following fields to these values:
39 | Grade out of 100 | 50 |
40 And I press "Save changes"
2615e429 41 And I press "OK"
fdeeaff9 42 And I am on "Course 1" course homepage
44f460c3 43 And I navigate to "View > Grader report" in the course gradebook
56913501 44 And I follow "Single view for Test assignment one"
4830f551
LB
45 Then the field "Grade for Student 1" matches value "50.00"
46 And the field "Override for Student 1" matches value "0"
47f084c6 47 And I set the field "Perform bulk insert" to "1"
56913501
DC
48 And I set the field "Insert value" to "1.0"
49 And I press "Save"
50 And I press "Continue"
4830f551
LB
51 And the field "Grade for Student 1" matches value "50.00"
52 And the field "Override for Student 1" matches value "0"
53 And the field "Grade for Student 2" matches value "1.00"
54 And the field "Override for Student 2" matches value "1"
55 And the field "Grade for Student 3" matches value "1.00"
56 And the field "Override for Student 3" matches value "1"
57 And the field "Grade for Student 4" matches value "1.00"
58 And the field "Override for Student 4" matches value "1"
47f084c6
AN
59 And I set the field "For" to "All grades"
60 And I set the field "Perform bulk insert" to "1"
56913501
DC
61 And I set the field "Insert value" to "2.0"
62 And I press "Save"
63 And I press "Continue"
4830f551
LB
64 And the field "Grade for Student 1" matches value "2.00"
65 And the field "Override for Student 1" matches value "1"
66 And the field "Grade for Student 2" matches value "2.00"
67 And the field "Override for Student 2" matches value "1"
68 And the field "Grade for Student 3" matches value "2.00"
69 And the field "Override for Student 3" matches value "1"
70 And the field "Grade for Student 4" matches value "2.00"
71 And the field "Override for Student 4" matches value "1"
56913501 72
56913501
DC
73 Scenario: I can bulk insert grades and check their override flags for user view.
74 Given I log in as "teacher1"
fdeeaff9 75 And I am on "Course 1" course homepage
56913501 76 And I follow "Test assignment two"
9bad658a 77 And I navigate to "View all submissions" in current page administration
821ab1bf 78 And I click on "Grade" "link" in the "Student 1" "table_row"
56913501
DC
79 And I set the following fields to these values:
80 | Grade out of 100 | 50 |
81 And I press "Save changes"
2615e429 82 And I press "OK"
fdeeaff9 83 And I am on "Course 1" course homepage
44f460c3 84 And I navigate to "View > Grader report" in the course gradebook
63e4df60
DW
85 # And I click on "input[title='Dock Navigation block']" "css_element"
86 # And I click on "input[title='Dock Administration block']" "css_element"
56913501 87 And I follow "Single view for Test assignment two"
47f084c6 88 And I select "Student 1" from the "Select user..." singleselect
56913501
DC
89 Then the field "Grade for Test assignment two" matches value "50.00"
90 And the field "Override for Test assignment two" matches value "0"
47f084c6
AN
91 And I set the field "For" to "Empty grades"
92 And I set the field "Perform bulk insert" to "1"
56913501
DC
93 And I set the field "Insert value" to "1.0"
94 And I press "Save"
95 And I press "Continue"
96 And the field "Grade for Test assignment two" matches value "50.00"
97 And the field "Override for Test assignment two" matches value "0"
98 And the field "Grade for Test assignment one" matches value "1.00"
99 And the field "Override for Test assignment one" matches value "1"
100 And the field "Grade for Test assignment three" matches value "1.00"
101 And the field "Override for Test assignment three" matches value "1"
102 And the field "Grade for Test assignment four" matches value "1.00"
103 And the field "Override for Test assignment four" matches value "1"
3e2b8b21
AG
104
105 Scenario: I can not update grades if the value is out of bounds.
106 Given I log in as "teacher1"
107 And I am on "Course 1" course homepage
108 And I navigate to "View > Grader report" in the course gradebook
109 And I follow "Single view for Test assignment one"
110 And I set the field "Perform bulk insert" to "1"
111 When I set the field "Insert value" to "-1"
112 And I press "Save"
4830f551
LB
113 Then I should see "The grade entered for Test assignment one for Student 1 is less than the minimum allowed"
114 And I should see "The grade entered for Test assignment one for Student 2 is less than the minimum allowed"
115 And I should see "The grade entered for Test assignment one for Student 3 is less than the minimum allowed"
116 And I should see "The grade entered for Test assignment one for Student 4 is less than the minimum allowed"
3e2b8b21 117 And I should see "Grades were set for 0 items"