1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Prevent or allow assignment submission changes
|
|
|
3 |
In order to control when a student can change his/her submission
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to prevent or allow student submission at any time
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
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 |
|
|
|
22 |
@javascript
|
|
|
23 |
Scenario: Preventing changes and allowing them again
|
|
|
24 |
Given the following "activity" exists:
|
|
|
25 |
| activity | assign |
|
|
|
26 |
| course | C1 |
|
|
|
27 |
| name | Test assignment name |
|
|
|
28 |
| intro | Submit your online text |
|
|
|
29 |
| submissiondrafts | 0 |
|
|
|
30 |
| assignsubmission_onlinetext_enabled | 1 |
|
|
|
31 |
| assignsubmission_file_enabled | 0 |
|
|
|
32 |
And the following "mod_assign > submissions" exist:
|
|
|
33 |
| assign | user | onlinetext |
|
|
|
34 |
| Test assignment name | student1 | I'm the student submission |
|
|
|
35 |
|
|
|
36 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
37 |
And I press "Edit submission"
|
|
|
38 |
And I set the following fields to these values:
|
|
|
39 |
| Online text | I'm the student submission and he/she edited me |
|
|
|
40 |
And I press "Save changes"
|
|
|
41 |
And I log out
|
|
|
42 |
|
|
|
43 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
44 |
When I follow "View all submissions"
|
|
|
45 |
And I open the action menu in "Student 1" "table_row"
|
|
|
46 |
And I follow "Prevent submission changes"
|
|
|
47 |
Then I should see "Submission changes not allowed"
|
|
|
48 |
And I log out
|
|
|
49 |
|
|
|
50 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
51 |
And "Edit submission" "button" should not exist
|
|
|
52 |
And I should see "This assignment is not accepting submissions"
|
|
|
53 |
And I log out
|
|
|
54 |
|
|
|
55 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
56 |
And I follow "View all submissions"
|
|
|
57 |
And I open the action menu in "Student 1" "table_row"
|
|
|
58 |
And I follow "Allow submission changes"
|
|
|
59 |
And I should not see "Submission changes not allowed"
|
|
|
60 |
And I log out
|
|
|
61 |
|
|
|
62 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
63 |
And I should not see "This assignment is not accepting submissions"
|
|
|
64 |
And I press "Edit submission"
|
|
|
65 |
And I set the following fields to these values:
|
|
|
66 |
| Online text | I'm the student submission edited again |
|
|
|
67 |
And I press "Save changes"
|
|
|
68 |
And I should see "I'm the student submission edited again"
|
|
|
69 |
|
|
|
70 |
@javascript @_alert
|
|
|
71 |
Scenario: Preventing changes and allowing them again (batch action)
|
|
|
72 |
Given the following "activities" exist:
|
|
|
73 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
|
|
|
74 |
| assign | C1 | Test assignment name | Test assignment description | 1 | 0 |
|
|
|
75 |
And the following "mod_assign > submissions" exist:
|
|
|
76 |
| assign | user | onlinetext |
|
|
|
77 |
| Test assignment name | student1 | I'm the student submission |
|
|
|
78 |
| Test assignment name | student2 | I'm the student2 submission |
|
|
|
79 |
|
|
|
80 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
81 |
When I follow "View all submissions"
|
|
|
82 |
And I set the field "selectall" to "1"
|
|
|
83 |
And I click on "Go" "button" confirming the dialogue
|
|
|
84 |
Then I should see "Submission changes not allowed" in the "Student 1" "table_row"
|
|
|
85 |
And I should see "Submission changes not allowed" in the "Student 2" "table_row"
|
|
|
86 |
And I log out
|
|
|
87 |
|
|
|
88 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
89 |
And I should not see "Edit submission"
|
|
|
90 |
And I log out
|
|
|
91 |
|
|
|
92 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
93 |
And I follow "View all submissions"
|
|
|
94 |
And I set the field "selectall" to "1"
|
|
|
95 |
And I set the field "id_operation" to "Unlock submissions"
|
|
|
96 |
And I click on "Go" "button" confirming the dialogue
|
|
|
97 |
And I should not see "Submission changes not allowed" in the "Student 1" "table_row"
|
|
|
98 |
And I should not see "Submission changes not allowed" in the "Student 2" "table_row"
|
|
|
99 |
And I log out
|
|
|
100 |
|
|
|
101 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
102 |
And I press "Edit submission"
|
|
|
103 |
And I set the following fields to these values:
|
|
|
104 |
| Online text | I'm the student2 submission and he/she edited me |
|
|
|
105 |
And I press "Save changes"
|