1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Grant an extension to an offline student
|
|
|
3 |
In order to allow students to have an accurate due date
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to grant students extensions at any time
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | groupmode |
|
1441 |
ariadna |
10 |
| Course 1 | C1 | 0 | 1 |
|
1 |
efrain |
11 |
And the following "users" exist:
|
1441 |
ariadna |
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 |
| student3 | Student | 3 | student3@example.com |
|
|
|
17 |
| student4 | Student | 4 | student4@example.com |
|
|
|
18 |
| student5 | Student | 5 | student5@example.com |
|
|
|
19 |
| student6 | Student | 6 | student6@example.com |
|
1 |
efrain |
20 |
And the following "course enrolments" exist:
|
1441 |
ariadna |
21 |
| user | course | role |
|
|
|
22 |
| teacher1 | C1 | editingteacher |
|
|
|
23 |
| student1 | C1 | student |
|
|
|
24 |
| student2 | C1 | student |
|
|
|
25 |
| student3 | C1 | student |
|
|
|
26 |
| student4 | C1 | student |
|
|
|
27 |
| student5 | C1 | student |
|
|
|
28 |
| student6 | C1 | student |
|
1 |
efrain |
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: Granting an extension to an offline assignment
|
|
|
32 |
Given the following "activities" exist:
|
1441 |
ariadna |
33 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
|
|
34 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | ## 2014-01-01 ## |
|
1 |
efrain |
35 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
1441 |
ariadna |
36 |
When I navigate to "Submissions" in current page administration
|
1 |
efrain |
37 |
And I open the action menu in "Student 1" "table_row"
|
|
|
38 |
And I follow "Grant extension"
|
|
|
39 |
And I should see "Student 1 (student1@example.com)"
|
1441 |
ariadna |
40 |
And I should see "Wednesday, 1 January 2014, 12:00 AM" in the "fitem_id_duedate" "region"
|
|
|
41 |
And I should see "Current extension due date" in the "fitem_id_currentextension" "region"
|
|
|
42 |
And I should see "None" in the "fitem_id_currentextension" "region"
|
|
|
43 |
And I set the field "Extension due date" to "## 2014-02-02 ##"
|
1 |
efrain |
44 |
And I press "Save changes"
|
|
|
45 |
Then I should see "Extension granted until:" in the "Student 1" "table_row"
|
1441 |
ariadna |
46 |
And I open the action menu in "Student 1" "table_row"
|
|
|
47 |
And I follow "Grant extension"
|
|
|
48 |
And I should see "Student 1 (student1@example.com)"
|
|
|
49 |
And I should see "Wednesday, 1 January 2014, 12:00 AM" in the "fitem_id_duedate" "region"
|
|
|
50 |
And I should see "Sunday, 2 February 2014, 12:00 AM" in the "fitem_id_currentextension" "region"
|
|
|
51 |
And the field "id_extensionduedate_day" matches value "2"
|
|
|
52 |
And the field "id_extensionduedate_month" matches value "February"
|
1 |
efrain |
53 |
And I log out
|
|
|
54 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
55 |
And I should see "Extension due date"
|
|
|
56 |
|
1441 |
ariadna |
57 |
@javascript
|
1 |
efrain |
58 |
Scenario: Granting extensions to an offline assignment (batch action)
|
|
|
59 |
Given the following "activities" exist:
|
1441 |
ariadna |
60 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
|
|
61 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | ## 2014-01-01 ## |
|
|
|
62 |
And the following "mod_assign > extensions" exist:
|
|
|
63 |
| assign | user | extensionduedate |
|
|
|
64 |
| Test assignment name | student2 | ## 2014-02-02 ## |
|
|
|
65 |
| Test assignment name | student3 | ## 2014-03-03 ## |
|
1 |
efrain |
66 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
1441 |
ariadna |
67 |
When I navigate to "Submissions" in current page administration
|
1 |
efrain |
68 |
And I set the field "selectall" to "1"
|
1441 |
ariadna |
69 |
And I click on "Extend" "button" in the "sticky-footer" "region"
|
|
|
70 |
And I click on "Extend" "button" in the "Grant extension" "dialogue"
|
1 |
efrain |
71 |
And I should see "Student 1 (student1@example.com)"
|
|
|
72 |
And I should see "Student 2 (student2@example.com)"
|
|
|
73 |
And I should see "Student 3 (student3@example.com)"
|
|
|
74 |
And I should see "Student 4 (student4@example.com)"
|
|
|
75 |
And I should see "Student 5 (student5@example.com)"
|
|
|
76 |
And I should see "1 more..."
|
1441 |
ariadna |
77 |
And I should see "Wednesday, 1 January 2014, 12:00 AM" in the "fitem_id_duedate" "region"
|
|
|
78 |
And I should see "Various between Sunday, 2 February 2014, 12:00 AM and Monday, 3 March 2014, 12:00 AM" in the "fitem_id_currentextension" "region"
|
|
|
79 |
And I should see "Users with no current extension: 4" in the "fitem_id_currentextension" "region"
|
1 |
efrain |
80 |
And I set the field "Enable" to "1"
|
|
|
81 |
And I press "Save changes"
|
|
|
82 |
Then I should see "Extension granted until:" in the "Student 1" "table_row"
|
|
|
83 |
And I should see "Extension granted until:" in the "Student 2" "table_row"
|
|
|
84 |
And I should see "Extension granted until:" in the "Student 3" "table_row"
|
|
|
85 |
And I should see "Extension granted until:" in the "Student 4" "table_row"
|
|
|
86 |
And I should see "Extension granted until:" in the "Student 5" "table_row"
|
|
|
87 |
And I should see "Extension granted until:" in the "Student 6" "table_row"
|
|
|
88 |
And I log out
|
|
|
89 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
90 |
And I should see "Extension due date"
|
|
|
91 |
|
|
|
92 |
@javascript
|
|
|
93 |
Scenario: Validating that extension date is after due date
|
|
|
94 |
Given the following "activities" exist:
|
1441 |
ariadna |
95 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
|
|
96 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | ## 2034-01-01 ## | ## 2034-01-02 ## |
|
1 |
efrain |
97 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
1441 |
ariadna |
98 |
When I navigate to "Submissions" in current page administration
|
1 |
efrain |
99 |
And I open the action menu in "Student 1" "table_row"
|
|
|
100 |
And I follow "Grant extension"
|
|
|
101 |
And I should see "Student 1 (student1@example.com)"
|
|
|
102 |
And I set the field "Enable" to "1"
|
|
|
103 |
And I set the following fields to these values:
|
|
|
104 |
| extensionduedate[day] | 1 |
|
|
|
105 |
And I press "Save changes"
|
|
|
106 |
Then I should see "Extension date must be after the due date"
|
|
|
107 |
And I set the following fields to these values:
|
1441 |
ariadna |
108 |
| extensionduedate[year] | 2023 |
|
1 |
efrain |
109 |
And I press "Save changes"
|
|
|
110 |
Then I should see "Extension date must be after the allow submissions from date"
|
|
|
111 |
|
1441 |
ariadna |
112 |
@javascript
|
1 |
efrain |
113 |
Scenario: Granting extensions to an offline assignment (batch action)
|
|
|
114 |
Given the following "activities" exist:
|
1441 |
ariadna |
115 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
|
|
116 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | ## 2034-01-01 ## | ## 2034-01-02 ## |
|
1 |
efrain |
117 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
1441 |
ariadna |
118 |
When I navigate to "Submissions" in current page administration
|
1 |
efrain |
119 |
And I set the field "selectall" to "1"
|
1441 |
ariadna |
120 |
And I click on "Extend" "button" in the "sticky-footer" "region"
|
|
|
121 |
And I click on "Extend" "button" in the "Grant extension" "dialogue"
|
1 |
efrain |
122 |
And I should see "Student 1 (student1@example.com)"
|
|
|
123 |
And I should see "Student 2 (student2@example.com)"
|
|
|
124 |
And I should see "Student 3 (student3@example.com)"
|
|
|
125 |
And I should see "Student 4 (student4@example.com)"
|
|
|
126 |
And I should see "Student 5 (student5@example.com)"
|
|
|
127 |
And I should see "1 more..."
|
|
|
128 |
And I set the field "Enable" to "1"
|
|
|
129 |
And I set the following fields to these values:
|
|
|
130 |
| extensionduedate[day] | 1 |
|
|
|
131 |
And I press "Save changes"
|
|
|
132 |
Then I should see "Extension date must be after the due date"
|
|
|
133 |
And I set the following fields to these values:
|
1441 |
ariadna |
134 |
| extensionduedate[year] | 2023 |
|
1 |
efrain |
135 |
And I press "Save changes"
|
|
|
136 |
Then I should see "Extension date must be after the allow submissions from date"
|