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 |
|
|
|
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 |
| 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 |
|
|
|
20 |
And the following "course enrolments" exist:
|
|
|
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 |
|
|
|
29 |
|
|
|
30 |
@javascript
|
|
|
31 |
Scenario: Granting an extension to an offline assignment
|
|
|
32 |
Given the following "activities" exist:
|
|
|
33 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
|
|
34 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 |
|
|
|
35 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
36 |
When I follow "View all submissions"
|
|
|
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)"
|
|
|
40 |
And I set the field "Enable" to "1"
|
|
|
41 |
And I press "Save changes"
|
|
|
42 |
Then I should see "Extension granted until:" in the "Student 1" "table_row"
|
|
|
43 |
And I log out
|
|
|
44 |
|
|
|
45 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
46 |
And I should see "Extension due date"
|
|
|
47 |
|
|
|
48 |
@javascript @_alert
|
|
|
49 |
Scenario: Granting extensions to an offline assignment (batch action)
|
|
|
50 |
Given the following "activities" exist:
|
|
|
51 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | duedate |
|
|
|
52 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 |
|
|
|
53 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
54 |
When I follow "View all submissions"
|
|
|
55 |
And I set the field "selectall" to "1"
|
|
|
56 |
And I set the field "operation" to "Grant extension"
|
|
|
57 |
And I click on "Go" "button" confirming the dialogue
|
|
|
58 |
And I should see "Student 1 (student1@example.com)"
|
|
|
59 |
And I should see "Student 2 (student2@example.com)"
|
|
|
60 |
And I should see "Student 3 (student3@example.com)"
|
|
|
61 |
And I should see "Student 4 (student4@example.com)"
|
|
|
62 |
And I should see "Student 5 (student5@example.com)"
|
|
|
63 |
And I should see "1 more..."
|
|
|
64 |
And I set the field "Enable" to "1"
|
|
|
65 |
And I press "Save changes"
|
|
|
66 |
Then I should see "Extension granted until:" in the "Student 1" "table_row"
|
|
|
67 |
And I should see "Extension granted until:" in the "Student 2" "table_row"
|
|
|
68 |
And I should see "Extension granted until:" in the "Student 3" "table_row"
|
|
|
69 |
And I should see "Extension granted until:" in the "Student 4" "table_row"
|
|
|
70 |
And I should see "Extension granted until:" in the "Student 5" "table_row"
|
|
|
71 |
And I should see "Extension granted until:" in the "Student 6" "table_row"
|
|
|
72 |
And I log out
|
|
|
73 |
|
|
|
74 |
And I am on the "Test assignment name" Activity page logged in as student1
|
|
|
75 |
And I should see "Extension due date"
|
|
|
76 |
|
|
|
77 |
@javascript
|
|
|
78 |
Scenario: Validating that extension date is after due date
|
|
|
79 |
Given the following "activities" exist:
|
|
|
80 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
|
|
81 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 | 1388620800 |
|
|
|
82 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
83 |
When I follow "View all submissions"
|
|
|
84 |
And I open the action menu in "Student 1" "table_row"
|
|
|
85 |
And I follow "Grant extension"
|
|
|
86 |
And I should see "Student 1 (student1@example.com)"
|
|
|
87 |
And I set the field "Enable" to "1"
|
|
|
88 |
And I set the following fields to these values:
|
|
|
89 |
| extensionduedate[day] | 1 |
|
|
|
90 |
And I press "Save changes"
|
|
|
91 |
Then I should see "Extension date must be after the due date"
|
|
|
92 |
And I set the following fields to these values:
|
|
|
93 |
| extensionduedate[year] | 2013 |
|
|
|
94 |
And I press "Save changes"
|
|
|
95 |
Then I should see "Extension date must be after the allow submissions from date"
|
|
|
96 |
|
|
|
97 |
@javascript @_alert
|
|
|
98 |
Scenario: Granting extensions to an offline assignment (batch action)
|
|
|
99 |
Given the following "activities" exist:
|
|
|
100 |
| activity | course | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled | allowsubmissionsfromdate | duedate |
|
|
|
101 |
| assign | C1 | Test assignment name | Test assignment description | 0 | 0 | 1388534400 | 1388620800 |
|
|
|
102 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
103 |
When I follow "View all submissions"
|
|
|
104 |
And I set the field "selectall" to "1"
|
|
|
105 |
And I set the field "operation" to "Grant extension"
|
|
|
106 |
And I click on "Go" "button" confirming the dialogue
|
|
|
107 |
And I should see "Student 1 (student1@example.com)"
|
|
|
108 |
And I should see "Student 2 (student2@example.com)"
|
|
|
109 |
And I should see "Student 3 (student3@example.com)"
|
|
|
110 |
And I should see "Student 4 (student4@example.com)"
|
|
|
111 |
And I should see "Student 5 (student5@example.com)"
|
|
|
112 |
And I should see "1 more..."
|
|
|
113 |
And I set the field "Enable" to "1"
|
|
|
114 |
And I set the following fields to these values:
|
|
|
115 |
| extensionduedate[day] | 1 |
|
|
|
116 |
And I press "Save changes"
|
|
|
117 |
Then I should see "Extension date must be after the due date"
|
|
|
118 |
And I set the following fields to these values:
|
|
|
119 |
| extensionduedate[year] | 2013 |
|
|
|
120 |
And I press "Save changes"
|
|
|
121 |
Then I should see "Extension date must be after the allow submissions from date"
|