1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Assign group override
|
|
|
3 |
In order to grant a group special access to an assignment
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to create an override for that group.
|
|
|
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 |
| student3 | Sam3 | Student3 | student3@example.com |
|
|
|
14 |
And the following "courses" exist:
|
|
|
15 |
| fullname | shortname | category |
|
|
|
16 |
| Course 1 | C1 | 0 |
|
|
|
17 |
And the following "course enrolments" exist:
|
|
|
18 |
| user | course | role |
|
|
|
19 |
| teacher1 | C1 | editingteacher |
|
|
|
20 |
| student1 | C1 | student |
|
|
|
21 |
| student2 | C1 | student |
|
|
|
22 |
| student3 | C1 | student |
|
|
|
23 |
And the following "groups" exist:
|
|
|
24 |
| name | course | idnumber |
|
|
|
25 |
| Group 1 | C1 | G1 |
|
|
|
26 |
| Group 2 | C1 | G2 |
|
|
|
27 |
Given the following "group members" exist:
|
|
|
28 |
| user | group |
|
|
|
29 |
| student1 | G1 |
|
|
|
30 |
| student2 | G2 |
|
|
|
31 |
| student3 | G1 |
|
|
|
32 |
And the following "activities" exist:
|
|
|
33 |
| activity | name | intro | course | assignsubmission_onlinetext_enabled |
|
|
|
34 |
| assign | Test assignment name | Submit your online text | C1 | 1 |
|
|
|
35 |
|
|
|
36 |
Scenario: Add, modify then delete a group override
|
|
|
37 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
38 |
When I navigate to "Overrides" in current page administration
|
|
|
39 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
40 |
And I press "Add group override"
|
|
|
41 |
And I set the following fields to these values:
|
|
|
42 |
| Override group | Group 1 |
|
|
|
43 |
| Due date | ##1 Jan 2020 08:00## |
|
|
|
44 |
And I press "Save"
|
|
|
45 |
Then I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
46 |
And I click on "Edit" "link" in the "Group 1" "table_row"
|
|
|
47 |
And I set the following fields to these values:
|
|
|
48 |
| Due date | ##1 Jan 2030 08:00## |
|
|
|
49 |
And I press "Save"
|
|
|
50 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
51 |
And I click on "Delete" "link"
|
|
|
52 |
And I press "Continue"
|
|
|
53 |
And I should not see "Group 1"
|
|
|
54 |
|
|
|
55 |
Scenario: Duplicate a user override
|
|
|
56 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
57 |
When I navigate to "Overrides" in current page administration
|
|
|
58 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
59 |
And I press "Add group override"
|
|
|
60 |
And I set the following fields to these values:
|
|
|
61 |
| Override group | Group 1 |
|
|
|
62 |
| Due date | ##1 Jan 2020 08:00## |
|
|
|
63 |
And I press "Save"
|
|
|
64 |
Then I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
65 |
And I click on "copy" "link"
|
|
|
66 |
And I set the following fields to these values:
|
|
|
67 |
| Override group | Group 2 |
|
|
|
68 |
| Due date | ##1 Jan 2030 08:00## |
|
|
|
69 |
And I press "Save"
|
|
|
70 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
71 |
And I should see "Group 2"
|
|
|
72 |
|
|
|
73 |
Scenario: Allow a group to have a different due date
|
|
|
74 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
75 |
When I navigate to "Settings" in current page administration
|
|
|
76 |
And I set the following fields to these values:
|
|
|
77 |
| Allow submissions from | disabled |
|
|
|
78 |
| Due date | ##1 Jan 2000 08:00## |
|
|
|
79 |
| Cut-off date | disabled |
|
|
|
80 |
And I press "Save and display"
|
|
|
81 |
And I navigate to "Overrides" in current page administration
|
|
|
82 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
83 |
And I press "Add group override"
|
|
|
84 |
And I set the following fields to these values:
|
|
|
85 |
| Override group | Group 1 |
|
|
|
86 |
| Due date | ##1 Jan 2020 08:00## |
|
|
|
87 |
And I press "Save"
|
|
|
88 |
And I should see "Wednesday, 1 January 2020, 8:00"
|
|
|
89 |
And I log out
|
|
|
90 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
91 |
Then the activity date in "Test assignment name" should contain "Due: Saturday, 1 January 2000, 8:00"
|
|
|
92 |
And I log out
|
|
|
93 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
94 |
And the activity date in "Test assignment name" should contain "Due: Wednesday, 1 January 2020, 8:00"
|
|
|
95 |
|
|
|
96 |
Scenario: Allow a group to have a different cut off date
|
|
|
97 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
98 |
When I navigate to "Settings" in current page administration
|
|
|
99 |
And I set the following fields to these values:
|
|
|
100 |
| Due date | disabled |
|
|
|
101 |
| Allow submissions from | disabled |
|
|
|
102 |
| Cut-off date | ##1 Jan 2000 08:00## |
|
|
|
103 |
And I press "Save and display"
|
|
|
104 |
And I navigate to "Overrides" in current page administration
|
|
|
105 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
106 |
And I press "Add group override"
|
|
|
107 |
And I set the following fields to these values:
|
|
|
108 |
| Override group | Group 1 |
|
|
|
109 |
| Cut-off date | ##1 Jan 2030 08:00## |
|
|
|
110 |
And I press "Save"
|
|
|
111 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
112 |
And I log out
|
|
|
113 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
114 |
Then I should not see "You have not made a submission yet."
|
|
|
115 |
And I log out
|
|
|
116 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
117 |
And I should see "No submissions have been made yet"
|
|
|
118 |
|
|
|
119 |
Scenario: Allow a group to have a different start date
|
|
|
120 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
121 |
When I navigate to "Settings" in current page administration
|
|
|
122 |
And I set the following fields to these values:
|
|
|
123 |
| Due date | disabled |
|
|
|
124 |
| Allow submissions from | ##1 January 2030 08:00## |
|
|
|
125 |
| Cut-off date | disabled |
|
|
|
126 |
And I press "Save and display"
|
|
|
127 |
And I navigate to "Overrides" in current page administration
|
|
|
128 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
129 |
And I press "Add group override"
|
|
|
130 |
And I set the following fields to these values:
|
|
|
131 |
| Override group | Group 1 |
|
|
|
132 |
| Allow submissions from | ##1 Jan 2015 08:00## |
|
|
|
133 |
And I press "Save"
|
|
|
134 |
And I should see "Thursday, 1 January 2015, 8:00"
|
|
|
135 |
And I log out
|
|
|
136 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
137 |
Then the activity date in "Test assignment name" should contain "Opens: Tuesday, 1 January 2030, 8:00"
|
|
|
138 |
And I should not see "Add submission"
|
|
|
139 |
And I log out
|
|
|
140 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
141 |
And I should not see "Tuesday, 1 January 2030, 8:00"
|
|
|
142 |
|
|
|
143 |
@javascript
|
|
|
144 |
Scenario: Add both a user and group override and verify that both are applied correctly
|
|
|
145 |
Given I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
146 |
When I navigate to "Settings" in current page administration
|
|
|
147 |
And I set the following fields to these values:
|
|
|
148 |
| Due date | disabled |
|
|
|
149 |
| Allow submissions from | ##1 January 2040 08:00## |
|
|
|
150 |
| Cut-off date | disabled |
|
|
|
151 |
| Group mode | Visible groups |
|
|
|
152 |
And I press "Save and display"
|
|
|
153 |
And I navigate to "Overrides" in current page administration
|
|
|
154 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
155 |
And I press "Add group override"
|
|
|
156 |
And I set the following fields to these values:
|
|
|
157 |
| Override group | Group 1 |
|
|
|
158 |
| Allow submissions from | ##1 January 2030 08:00## |
|
|
|
159 |
And I press "Save"
|
|
|
160 |
And I should see "Tuesday, 1 January 2030, 8:00"
|
|
|
161 |
And I am on the "Test assignment name" Activity page
|
|
|
162 |
And I navigate to "Overrides" in current page administration
|
|
|
163 |
And I press "Add user override"
|
|
|
164 |
And I set the following fields to these values:
|
|
|
165 |
| Override user | Student1 |
|
|
|
166 |
| Allow submissions from | ##1 January 2031 08:00## |
|
|
|
167 |
And I press "Save"
|
|
|
168 |
And I should see "Wednesday, 1 January 2031, 8:00"
|
|
|
169 |
And I log out
|
|
|
170 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
171 |
And the activity date in "Test assignment name" should contain "Opens: Wednesday, 1 January 2031, 8:00"
|
|
|
172 |
And I log out
|
|
|
173 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
174 |
And the activity date in "Test assignment name" should contain "Opens: Sunday, 1 January 2040, 8:00"
|
|
|
175 |
And I log out
|
|
|
176 |
And I am on the "Test assignment name" Activity page logged in as student3
|
|
|
177 |
And the activity date in "Test assignment name" should contain "Opens: Tuesday, 1 January 2030, 8:00"
|
|
|
178 |
|
|
|
179 |
Scenario: Override a group when teacher is in no group, and does not have accessallgroups permission, and the activity's group mode is "separate groups"
|
|
|
180 |
Given the following "permission overrides" exist:
|
|
|
181 |
| capability | permission | role | contextlevel | reference |
|
|
|
182 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
183 |
And the following "activities" exist:
|
|
|
184 |
| activity | name | intro | course | groupmode |
|
|
|
185 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
186 |
And I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
187 |
When I navigate to "Overrides" in current page administration
|
|
|
188 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
189 |
Then I should see "No groups you can access."
|
|
|
190 |
And the "Add group override" "button" should be disabled
|
|
|
191 |
|
|
|
192 |
Scenario: A teacher without accessallgroups permission should only be able to add group override for groups that he/she is a member of,
|
|
|
193 |
when the activity's group mode is "separate groups"
|
|
|
194 |
Given the following "permission overrides" exist:
|
|
|
195 |
| capability | permission | role | contextlevel | reference |
|
|
|
196 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
197 |
And the following "activities" exist:
|
|
|
198 |
| activity | name | intro | course | groupmode |
|
|
|
199 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
200 |
And the following "group members" exist:
|
|
|
201 |
| user | group |
|
|
|
202 |
| teacher1 | G1 |
|
|
|
203 |
And I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
204 |
When I navigate to "Overrides" in current page administration
|
|
|
205 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
206 |
And I press "Add group override"
|
|
|
207 |
Then the "Override group" select box should contain "Group 1"
|
|
|
208 |
And the "Override group" select box should not contain "Group 2"
|
|
|
209 |
|
|
|
210 |
Scenario: A teacher without accessallgroups permission should only be able to see the group overrides for groups that he/she is a member of,
|
|
|
211 |
when the activity's group mode is "separate groups"
|
|
|
212 |
Given the following "permission overrides" exist:
|
|
|
213 |
| capability | permission | role | contextlevel | reference |
|
|
|
214 |
| moodle/site:accessallgroups | Prevent | editingteacher | Course | C1 |
|
|
|
215 |
And the following "activities" exist:
|
|
|
216 |
| activity | name | intro | course | groupmode |
|
|
|
217 |
| assign | Assignment 2 | Assignment 2 description | C1 | 1 |
|
|
|
218 |
And the following "group members" exist:
|
|
|
219 |
| user | group |
|
|
|
220 |
| teacher1 | G1 |
|
|
|
221 |
And I am on the "Assignment 2" Activity page logged in as admin
|
|
|
222 |
And I navigate to "Overrides" in current page administration
|
|
|
223 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
224 |
And I press "Add group override"
|
|
|
225 |
And I set the following fields to these values:
|
|
|
226 |
| Override group | Group 1 |
|
|
|
227 |
| Allow submissions from | ##1 January 2020 08:00## |
|
|
|
228 |
And I press "Save and enter another override"
|
|
|
229 |
And I set the following fields to these values:
|
|
|
230 |
| Override group | Group 2 |
|
|
|
231 |
| Allow submissions from | ##1 January 2020 08:00## |
|
|
|
232 |
And I press "Save"
|
|
|
233 |
And I log out
|
|
|
234 |
|
|
|
235 |
When I am on the "Assignment 2" Activity page logged in as teacher1
|
|
|
236 |
And I navigate to "Overrides" in current page administration
|
|
|
237 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
238 |
Then I should see "Group 1" in the ".generaltable" "css_element"
|
|
|
239 |
And I should not see "Group 2" in the ".generaltable" "css_element"
|
|
|
240 |
|
|
|
241 |
Scenario: "Not visible" groups should not be available for group overrides
|
|
|
242 |
Given the following "groups" exist:
|
|
|
243 |
| name | course | idnumber | visibility | participation |
|
|
|
244 |
| Visible to everyone/Participation | C1 | VP | 0 | 1 |
|
|
|
245 |
| Only visible to members/Participation | C1 | MP | 1 | 1 |
|
|
|
246 |
| Only see own membership | C1 | O | 2 | 0 |
|
|
|
247 |
| Not visible | C1 | N | 3 | 0 |
|
|
|
248 |
| Visible to everyone/Non-Participation | C1 | VN | 0 | 0 |
|
|
|
249 |
| Only visible to members/Non-Participation | C1 | MN | 1 | 0 |
|
|
|
250 |
When I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
251 |
And I navigate to "Overrides" in current page administration
|
|
|
252 |
And I select "Group overrides" from the "jump" singleselect
|
|
|
253 |
And I press "Add group override"
|
|
|
254 |
Then I should see "Visible to everyone/Participation" in the "Override group" "select"
|
|
|
255 |
And I should see "Visible to everyone/Non-Participation" in the "Override group" "select"
|
|
|
256 |
And I should see "Only visible to members" in the "Override group" "select"
|
|
|
257 |
And I should see "Only visible to members/Non-Participation" in the "Override group" "select"
|
|
|
258 |
And I should see "Only see own membership" in the "Override group" "select"
|
|
|
259 |
And I should not see "Not visible" in the "Override group" "select"
|