1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Assign user override
|
|
|
3 |
In order to grant a student special access to an assignment
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to create an override for that user.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Tina | Teacher1 | teacher1@example.com |
|
|
|
11 |
| student1 | Sam1 | Student1 | student1@example.com |
|
|
|
12 |
| student2 | Sam2 | Student2 | student2@example.com |
|
|
|
13 |
And the following "courses" exist:
|
|
|
14 |
| fullname | shortname | category |
|
|
|
15 |
| Course 1 | C1 | 0 |
|
|
|
16 |
And the following "course enrolments" exist:
|
|
|
17 |
| user | course | role |
|
|
|
18 |
| teacher1 | C1 | editingteacher |
|
|
|
19 |
| student1 | C1 | student |
|
|
|
20 |
| student2 | C1 | student |
|
|
|
21 |
And the following "activities" exist:
|
|
|
22 |
| activity | name | intro | course | assignsubmission_onlinetext_enabled |
|
|
|
23 |
| assign | Test assignment name | Submit your online text | C1 | 1 |
|
|
|
24 |
|
|
|
25 |
@javascript
|
|
|
26 |
Scenario: Add, modify then delete a user override
|
|
|
27 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
28 |
When I navigate to "Overrides" in current page administration
|
|
|
29 |
And I press "Add user override"
|
|
|
30 |
And I set the following fields to these values:
|
|
|
31 |
| Override user | Student1 |
|
|
|
32 |
| Due date | ##first day of January 2020 08:00## |
|
|
|
33 |
And I press "Save"
|
|
|
34 |
Then I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
35 |
And I click on "Edit" "link" in the "Sam1 Student1" "table_row"
|
|
|
36 |
And I set the following fields to these values:
|
|
|
37 |
| Due date | ##first day of January 2030 08:00## |
|
|
|
38 |
And I press "Save"
|
|
|
39 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
40 |
And I click on "Delete" "link"
|
|
|
41 |
And I press "Continue"
|
|
|
42 |
And I should not see "Sam1 Student1"
|
|
|
43 |
|
|
|
44 |
@javascript
|
|
|
45 |
Scenario: Duplicate a user override
|
|
|
46 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
47 |
When I navigate to "Overrides" in current page administration
|
|
|
48 |
And I press "Add user override"
|
|
|
49 |
And I set the following fields to these values:
|
|
|
50 |
| Override user | Student1 |
|
|
|
51 |
| Due date | ##2020-01-01 08:00## |
|
|
|
52 |
And I press "Save"
|
|
|
53 |
Then I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
54 |
And I click on "copy" "link"
|
|
|
55 |
And I set the following fields to these values:
|
|
|
56 |
| Override user | Student2 |
|
|
|
57 |
| Due date | ##2030-01-01 08:00## |
|
|
|
58 |
And I press "Save"
|
|
|
59 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
60 |
And I should see "Sam2 Student2"
|
|
|
61 |
|
|
|
62 |
@javascript
|
|
|
63 |
Scenario: Allow a user to have a different due date
|
|
|
64 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
65 |
When I navigate to "Settings" in current page administration
|
|
|
66 |
And I set the following fields to these values:
|
|
|
67 |
| Allow submissions from | disabled |
|
|
|
68 |
| Due date | ##1 Jan 2000 08:00## |
|
|
|
69 |
| Cut-off date | disabled |
|
|
|
70 |
And I press "Save and display"
|
|
|
71 |
And I navigate to "Overrides" in current page administration
|
|
|
72 |
And I press "Add user override"
|
|
|
73 |
And I set the following fields to these values:
|
|
|
74 |
| Override user | Student1 |
|
|
|
75 |
| Due date | ##1 Jan 2020 08:00## |
|
|
|
76 |
And I press "Save"
|
|
|
77 |
Then I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
78 |
And I log out
|
|
|
79 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
80 |
And the activity date in "Test assignment name" should contain "Due: Saturday, 1 January 2000, 8:00"
|
|
|
81 |
And I log out
|
|
|
82 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
83 |
And the activity date in "Test assignment name" should contain "Due: Wednesday, 1 January 2020, 8:00"
|
|
|
84 |
|
|
|
85 |
@javascript
|
|
|
86 |
Scenario: Allow a user to have a different cut off date
|
|
|
87 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
88 |
When I navigate to "Settings" in current page administration
|
|
|
89 |
And I set the following fields to these values:
|
|
|
90 |
| Due date | disabled |
|
|
|
91 |
| Allow submissions from | disabled |
|
|
|
92 |
| Cut-off date | ##1 Jan 2000 08:00## |
|
|
|
93 |
And I press "Save and display"
|
|
|
94 |
And I navigate to "Overrides" in current page administration
|
|
|
95 |
And I press "Add user override"
|
|
|
96 |
And I set the following fields to these values:
|
|
|
97 |
| Override user | Student1 |
|
|
|
98 |
| Cut-off date | ##1 Jan 2030 08:00## |
|
|
|
99 |
And I press "Save"
|
|
|
100 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
101 |
And I log out
|
|
|
102 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
103 |
Then I should not see "Add submission"
|
|
|
104 |
And I log out
|
|
|
105 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
106 |
And I should see "Add submission"
|
|
|
107 |
|
|
|
108 |
@javascript
|
|
|
109 |
Scenario: Allow a user to have a different start date
|
|
|
110 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
111 |
When I navigate to "Settings" in current page administration
|
|
|
112 |
And I set the following fields to these values:
|
|
|
113 |
| Due date | disabled |
|
|
|
114 |
| Allow submissions from | ##1 January 2030 08:00## |
|
|
|
115 |
| Cut-off date | disabled |
|
|
|
116 |
And I press "Save and display"
|
|
|
117 |
And I navigate to "Overrides" in current page administration
|
|
|
118 |
And I press "Add user override"
|
|
|
119 |
And I set the following fields to these values:
|
|
|
120 |
| Override user | Student1 |
|
|
|
121 |
| Allow submissions from | ##1 Jan 2015 08:00## |
|
|
|
122 |
And I press "Save"
|
|
|
123 |
And I should see "Thursday, 1 January 2015, 8:00"
|
|
|
124 |
And I log out
|
|
|
125 |
And I log in as "student2"
|
|
|
126 |
And I am on "Course 1" course homepage
|
|
|
127 |
And I click on "Test assignment name" "link" in the "region-main" "region"
|
|
|
128 |
Then the activity date in "Test assignment name" should contain "Opens: Tuesday, 1 January 2030, 8:00"
|
|
|
129 |
And I log out
|
|
|
130 |
And I log in as "student1"
|
|
|
131 |
And I am on "Course 1" course homepage
|
|
|
132 |
And I click on "Test assignment name" "link" in the "region-main" "region"
|
|
|
133 |
And I should not see "1 January 2030, 8:00"
|
|
|
134 |
|
|
|
135 |
Scenario: Override a user when teacher is in no group, and does not have accessallgroups permission, and the activity's group mode is "separate groups"
|
|
|
136 |
Given the following "permission overrides" exist:
|
|
|
137 |
| capability | permission | role | contextlevel | reference |
|
|
|
138 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
139 |
And the following "activities" exist:
|
|
|
140 |
| activity | name | intro | course | groupmode |
|
|
|
141 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
142 |
And I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
143 |
When I navigate to "Overrides" in current page administration
|
|
|
144 |
Then I should see "No groups you can access."
|
|
|
145 |
And the "Add user override" "button" should be disabled
|
|
|
146 |
|
|
|
147 |
Scenario: A teacher without accessallgroups permission should only be able to add user override for users that he/she shares groups with,
|
|
|
148 |
when the activity's group mode is "separate groups"
|
|
|
149 |
Given the following "permission overrides" exist:
|
|
|
150 |
| capability | permission | role | contextlevel | reference |
|
|
|
151 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
152 |
And the following "activities" exist:
|
|
|
153 |
| activity | name | intro | course | groupmode |
|
|
|
154 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
155 |
And the following "groups" exist:
|
|
|
156 |
| name | course | idnumber |
|
|
|
157 |
| Group 1 | C1 | G1 |
|
|
|
158 |
| Group 2 | C1 | G2 |
|
|
|
159 |
And the following "group members" exist:
|
|
|
160 |
| user | group |
|
|
|
161 |
| teacher1 | G1 |
|
|
|
162 |
| student1 | G1 |
|
|
|
163 |
| student2 | G2 |
|
|
|
164 |
And I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
165 |
When I navigate to "Overrides" in current page administration
|
|
|
166 |
And I press "Add user override"
|
|
|
167 |
Then the "Override user" select box should contain "Sam1 Student1, student1@example.com"
|
|
|
168 |
And the "Override user" select box should not contain "Sam2 Student2, student2@example.com"
|
|
|
169 |
|
|
|
170 |
@javascript
|
|
|
171 |
Scenario: A teacher without accessallgroups permission should only be able to see the user override for users that he/she shares groups with,
|
|
|
172 |
when the activity's group mode is "separate groups"
|
|
|
173 |
Given the following "permission overrides" exist:
|
|
|
174 |
| capability | permission | role | contextlevel | reference |
|
|
|
175 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
176 |
And the following "activities" exist:
|
|
|
177 |
| activity | name | intro | course | groupmode |
|
|
|
178 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
179 |
And the following "groups" exist:
|
|
|
180 |
| name | course | idnumber |
|
|
|
181 |
| Group 1 | C1 | G1 |
|
|
|
182 |
| Group 2 | C1 | G2 |
|
|
|
183 |
And the following "group members" exist:
|
|
|
184 |
| user | group |
|
|
|
185 |
| teacher1 | G1 |
|
|
|
186 |
| student1 | G1 |
|
|
|
187 |
| student2 | G2 |
|
|
|
188 |
And I am on the "Assignment 2" Activity page logged in as admin
|
|
|
189 |
And I navigate to "Overrides" in current page administration
|
|
|
190 |
And I press "Add user override"
|
|
|
191 |
And I set the following fields to these values:
|
|
|
192 |
| Override user | Student1 |
|
|
|
193 |
| Allow submissions from | ##first day of January 2015 08:00## |
|
|
|
194 |
And I press "Save and enter another override"
|
|
|
195 |
And I set the following fields to these values:
|
|
|
196 |
| Override user | Student2 |
|
|
|
197 |
| Allow submissions from | ##first day of January 2015 08:00## |
|
|
|
198 |
And I press "Save"
|
|
|
199 |
And I log out
|
|
|
200 |
|
|
|
201 |
And I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
202 |
When I navigate to "Overrides" in current page administration
|
|
|
203 |
Then I should see "Student1" in the ".generaltable" "css_element"
|
|
|
204 |
But I should not see "Student2" in the ".generaltable" "css_element"
|
|
|
205 |
|
|
|
206 |
@javascript
|
|
|
207 |
Scenario: Create a user override when the assignment is not available to the student
|
|
|
208 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
209 |
And I navigate to "Settings" in current page administration
|
|
|
210 |
And I expand all fieldsets
|
|
|
211 |
And I set the field "Availability" to "Hide on course page"
|
|
|
212 |
And I click on "Save and display" "button"
|
|
|
213 |
When I navigate to "Overrides" in current page administration
|
|
|
214 |
And I press "Add user override"
|
|
|
215 |
And I set the following fields to these values:
|
|
|
216 |
| Override user | Student1 |
|
|
|
217 |
| Allow submissions from | ##1 Jan 2015 08:00## |
|
|
|
218 |
And I press "Save"
|
|
|
219 |
Then I should see "This override is inactive"
|
|
|
220 |
And "Edit" "icon" should exist in the "Sam1 Student1" "table_row"
|
|
|
221 |
And "copy" "icon" should exist in the "Sam1 Student1" "table_row"
|
|
|
222 |
And "Delete" "icon" should exist in the "Sam1 Student1" "table_row"
|