1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Bulk remove submissions
|
|
|
3 |
In order to reset the assignment submission of multiple students
|
|
|
4 |
As a teacher with the capability to edit submissions
|
|
|
5 |
I need to be able to remove student submissions by bulk
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 0 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
14 |
| student1 | Student | 1 | student1@example.com |
|
|
|
15 |
| student2 | Student | 2 | student2@example.com |
|
|
|
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 "groups" exist:
|
|
|
22 |
| name | course | idnumber |
|
|
|
23 |
| Group 1 | C1 | G1 |
|
|
|
24 |
|
|
|
25 |
@javascript @skip_chrome_zerosize
|
|
|
26 |
Scenario: Bulk remove submissions should remove the data that was submitted
|
|
|
27 |
Given the following "activity" exists:
|
|
|
28 |
| activity | assign |
|
|
|
29 |
| course | C1 |
|
|
|
30 |
| name | Test assignment name |
|
|
|
31 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
32 |
| assignsubmission_file_enabled | 0 |
|
|
|
33 |
| submissiondrafts | 0 |
|
|
|
34 |
And the following "mod_assign > submissions" exist:
|
|
|
35 |
| assign | user | onlinetext |
|
|
|
36 |
| Test assignment name | student1 | I'm the student1 submission |
|
|
|
37 |
| Test assignment name | student2 | I'm the student2 submission |
|
|
|
38 |
And the following "role capability" exists:
|
|
|
39 |
| role | editingteacher |
|
|
|
40 |
| mod/assign:editothersubmission | allow |
|
|
|
41 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
42 |
And I follow "View all submissions"
|
|
|
43 |
And I should see "I'm the student1 submission"
|
|
|
44 |
And I should see "I'm the student2 submission"
|
|
|
45 |
And I set the field "selectall" to "1"
|
|
|
46 |
When I set the field "operation" to "Remove submission"
|
|
|
47 |
And I click on "Go" "button" confirming the dialogue
|
|
|
48 |
Then I should not see "I'm the student1 submission"
|
|
|
49 |
And I should not see "I'm the student2 submission"
|
|
|
50 |
And I log out
|
|
|
51 |
|
|
|
52 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
53 |
And I should not see "I'm the student1 submission"
|
|
|
54 |
And I log out
|
|
|
55 |
|
|
|
56 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
57 |
And I should not see "I'm the student2 submission1"
|
|
|
58 |
|
|
|
59 |
@javascript
|
|
|
60 |
Scenario: Bulk remove submissions should be unavailable if the user is missing the editing submission capability
|
|
|
61 |
Given the following "activity" exists:
|
|
|
62 |
| activity | assign |
|
|
|
63 |
| course | C1 |
|
|
|
64 |
| name | Test assignment name |
|
|
|
65 |
| intro | Submit your online text |
|
|
|
66 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
67 |
| assignsubmission_file_enabled | 0 |
|
|
|
68 |
| submissiondrafts | 0 |
|
|
|
69 |
And the following "mod_assign > submissions" exist:
|
|
|
70 |
| assign | user | onlinetext |
|
|
|
71 |
| Test assignment name | student1 | I'm the student1 submission |
|
|
|
72 |
| Test assignment name | student2 | I'm the student2 submission |
|
|
|
73 |
|
|
|
74 |
When I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
75 |
And I follow "View all submissions"
|
|
|
76 |
And I should see "I'm the student1 submission"
|
|
|
77 |
And I should see "I'm the student2 submission"
|
|
|
78 |
And I set the field "selectall" to "1"
|
|
|
79 |
Then I should not see "Remove submission" in the "Choose operation" "select"
|
|
|
80 |
|
|
|
81 |
@javascript @skip_chrome_zerosize
|
|
|
82 |
Scenario: Notification should be displayed when non-group users are selected for submission bulk removal
|
|
|
83 |
in separate group mode
|
|
|
84 |
Given the following "activity" exists:
|
|
|
85 |
| activity | assign |
|
|
|
86 |
| course | C1 |
|
|
|
87 |
| name | Test assignment name |
|
|
|
88 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
89 |
| assignsubmission_file_enabled | 0 |
|
|
|
90 |
| groupmode | 1 |
|
|
|
91 |
| submissiondrafts | 0 |
|
|
|
92 |
And the following "mod_assign > submissions" exist:
|
|
|
93 |
| assign | user | onlinetext |
|
|
|
94 |
| Test assignment name | student1 | I'm the student1 submission |
|
|
|
95 |
| Test assignment name | student2 | I'm the student2 submission |
|
|
|
96 |
And the following "role capability" exists:
|
|
|
97 |
| role | editingteacher |
|
|
|
98 |
| mod/assign:editothersubmission | allow |
|
|
|
99 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
100 |
And I follow "View all submissions"
|
|
|
101 |
And I should see "I'm the student1 submission"
|
|
|
102 |
And I should see "I'm the student2 submission"
|
|
|
103 |
And I set the field "selectall" to "1"
|
|
|
104 |
When I set the field "operation" to "Remove submission"
|
|
|
105 |
And I click on "Go" "button" confirming the dialogue
|
|
|
106 |
|
|
|
107 |
Then I should see "I'm the student1 submission"
|
|
|
108 |
And I should see "I'm the student2 submission"
|
|
|
109 |
And I should see "The submission of Student 1 cannot be removed"
|
|
|
110 |
And I should see "The submission of Student 2 cannot be removed"
|
|
|
111 |
|
|
|
112 |
@javascript @skip_chrome_zerosize
|
|
|
113 |
Scenario: Bulk remove submission when group users are added to the bulk
|
|
|
114 |
removing submissions process in separate group mode
|
|
|
115 |
Given the following "group members" exist:
|
|
|
116 |
| user | group |
|
|
|
117 |
| student1 | G1 |
|
|
|
118 |
| student2 | G1 |
|
|
|
119 |
And the following "activity" exists:
|
|
|
120 |
| activity | assign |
|
|
|
121 |
| course | C1 |
|
|
|
122 |
| name | Test assignment name |
|
|
|
123 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
124 |
| assignsubmission_file_enabled | 0 |
|
|
|
125 |
| groupmode | 1 |
|
|
|
126 |
| submissiondrafts | 0 |
|
|
|
127 |
And the following "mod_assign > submissions" exist:
|
|
|
128 |
| assign | user | onlinetext |
|
|
|
129 |
| Test assignment name | student1 | I'm the student1 submission |
|
|
|
130 |
| Test assignment name | student2 | I'm the student2 submission |
|
|
|
131 |
And the following "role capability" exists:
|
|
|
132 |
| role | editingteacher |
|
|
|
133 |
| mod/assign:editothersubmission | allow |
|
|
|
134 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
135 |
And I follow "View all submissions"
|
|
|
136 |
And I should see "I'm the student1 submission"
|
|
|
137 |
And I should see "I'm the student2 submission"
|
|
|
138 |
And I set the field "selectall" to "1"
|
|
|
139 |
When I set the field "operation" to "Remove submission"
|
|
|
140 |
And I click on "Go" "button" confirming the dialogue
|
|
|
141 |
Then I should not see "I'm the student1 submission"
|
|
|
142 |
And I should not see "I'm the student2 submission"
|