1 |
efrain |
1 |
@mod @mod_assign
|
|
|
2 |
Feature: Relative assignment due dates
|
|
|
3 |
In order for students to be able to enter the course at any time and have a fixed period in which to submit the assignment
|
|
|
4 |
As a teacher in course with relative dates mode enabled
|
|
|
5 |
I should be able to create an assignment with a due date relative to the course start date
|
|
|
6 |
|
|
|
7 |
Scenario: As a student the due date for submitting my assignment is relative to my course start date
|
|
|
8 |
Given the following config values are set as admin:
|
|
|
9 |
| enablecourserelativedates | 1 |
|
|
|
10 |
And the following "courses" exist:
|
|
|
11 |
| fullname | shortname | category | groupmode | relativedatesmode | startdate |
|
|
|
12 |
| Course 1 | C1 | 0 | 1 | 1 | ##first day of -4 months## |
|
|
|
13 |
And the following "users" exist:
|
|
|
14 |
| username | firstname | lastname | email |
|
|
|
15 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
16 |
| student1 | Student | 1 | student1@example.com |
|
|
|
17 |
| student2 | Student | 2 | student2@example.com |
|
|
|
18 |
And the following "course enrolments" exist:
|
|
|
19 |
# Two students, one started 4 months ago and one yesterday.
|
|
|
20 |
| user | course | role | timestart |
|
|
|
21 |
| teacher1 | C1 | editingteacher | ##first day of last month## |
|
|
|
22 |
| student1 | C1 | student | ##first day of -4 months## |
|
|
|
23 |
| student2 | C1 | student | ##yesterday## |
|
|
|
24 |
# One assignment, valid for 2 months.
|
|
|
25 |
And the following "activities" exist:
|
|
|
26 |
| activity | name | course | assignsubmission_onlinetext_enabled | timeopen | duedate |
|
|
|
27 |
| assign | Test assignment name | C1 | 1 | ##first day of -4 months## | ##last day of -3 months## |
|
|
|
28 |
|
|
|
29 |
When I am on the "Test assignment name" Activity page logged in as student1
|
|
|
30 |
Then I should see "Assignment is overdue by:" in the "Time remaining" "table_row"
|
|
|
31 |
And I log out
|
|
|
32 |
|
|
|
33 |
And I am on the "Test assignment name" Activity page logged in as student2
|
|
|
34 |
And I should not see "Assignment is overdue by:" in the "Time remaining" "table_row"
|
|
|
35 |
|
|
|
36 |
Scenario: As a student the due date I see for submitting my assignment is relative to my course start date
|
|
|
37 |
Given the following config values are set as admin:
|
|
|
38 |
| enablecourserelativedates | 1 |
|
|
|
39 |
And the following "courses" exist:
|
|
|
40 |
# A course with start date set to 1 Jan 2021.
|
|
|
41 |
| fullname | shortname | category | groupmode | relativedatesmode | startdate |
|
|
|
42 |
| Course 1 | C1 | 0 | 1 | 1 | 1609459200 |
|
|
|
43 |
And the following "users" exist:
|
|
|
44 |
| username | firstname | lastname | email |
|
|
|
45 |
| student1 | Student | 1 | student1@example.com |
|
|
|
46 |
And the following "course enrolments" exist:
|
|
|
47 |
# User's enrolment starts from 5 Jan 2021.
|
|
|
48 |
| user | course | role | timestart |
|
|
|
49 |
| student1 | C1 | student | 1609804800 |
|
|
|
50 |
And the following "activities" exist:
|
|
|
51 |
# The assignment's due date is 3 Jan 2021.
|
|
|
52 |
| activity | name | course | assignsubmission_onlinetext_enabled | duedate |
|
|
|
53 |
| assign | Test assignment name | C1 | 1 | 1609632000 |
|
|
|
54 |
|
|
|
55 |
When I am on the "Test assignment name" Activity page logged in as student1
|
|
|
56 |
Then the activity date in "Test assignment name" should contain "Due: Thursday, 7 January 2021, 8:00"
|
|
|
57 |
|
|
|
58 |
Scenario: As a teacher, I should see the relative dates when reviewing assignment submissions
|
|
|
59 |
Given the following config values are set as admin:
|
|
|
60 |
| enablecourserelativedates | 1 |
|
|
|
61 |
And the following "courses" exist:
|
|
|
62 |
| fullname | shortname | category | groupmode | relativedatesmode | startdate |
|
|
|
63 |
| Course 1 | C1 | 0 | 1 | 1 | ##first day of 4 months ago## |
|
|
|
64 |
And the following "users" exist:
|
|
|
65 |
| username | firstname | lastname | email |
|
|
|
66 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
67 |
| student1 | Student | 1 | student1@example.com |
|
|
|
68 |
| student2 | Student | 2 | student2@example.com |
|
|
|
69 |
And the following "course enrolments" exist:
|
|
|
70 |
# Two students, one started 4 months ago and one yesterday.
|
|
|
71 |
| user | course | role | timestart |
|
|
|
72 |
| teacher1 | C1 | editingteacher | ##first day of 4 months ago## |
|
|
|
73 |
| student1 | C1 | student | ##first day of 4 months ago## |
|
|
|
74 |
| student2 | C1 | student | ##yesterday## |
|
|
|
75 |
# One assignment, valid for 2 months.
|
|
|
76 |
And the following "activities" exist:
|
|
|
77 |
| activity | name | course | assignsubmission_onlinetext_enabled | timeopen | duedate |
|
|
|
78 |
| assign | Test assignment name | C1 | 1 | ##first day of 4 months ago## | ##last day of 3 months ago## |
|
|
|
79 |
|
|
|
80 |
And I am on the "Test assignment name" Activity page logged in as teacher1
|
|
|
81 |
And the activity date in "Test assignment name" should contain "after course start"
|
|
|
82 |
And I should see "Calculated for each student" in the "Time remaining" "table_row"
|
|
|
83 |
When I follow "View all submissions"
|
|
|
84 |
Then I should see "No submission" in the "Student 1" "table_row"
|
|
|
85 |
And I should see "Assignment is overdue by:" in the "Student 1" "table_row"
|
|
|
86 |
And I should see "No submission" in the "Student 2" "table_row"
|
|
|
87 |
And I should not see "Assignment is overdue by:" in the "Student 2" "table_row"
|