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
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 | intro | course | idnumber | assignsubmission_onlinetext_enabled | timeopen | duedate |
27 | assign | Test assignment name | Test assignment description | C1 | assign0 | 1 |##first day of -4 months## | ##last day of -3 months## |
28 When I log in as "student1"
29 And I am on "Course 1" course homepage
30 And I follow "Test assignment name"
31 Then I should see "Assignment is overdue by:" in the "Time remaining" "table_row"
33 And I log in as "student2"
34 And I am on "Course 1" course homepage
35 And I follow "Test assignment name"
36 And I should not see "Assignment is overdue by:" in the "Time remaining" "table_row"
38 Scenario: As a student the due date I see for submitting my assignment is relative to my course start date
39 Given the following config values are set as admin:
40 | enablecourserelativedates | 1 |
41 And the following "courses" exist:
42 # A course with start date set to 1 Jan 2021.
43 | fullname | shortname | category | groupmode | relativedatesmode | startdate |
44 | Course 1 | C1 | 0 | 1 | 1 | 1609459200 |
45 And the following "users" exist:
46 | username | firstname | lastname | email |
47 | student1 | Student | 1 | student1@example.com |
48 And the following "course enrolments" exist:
49 # User's enrolment starts from 5 Jan 2021.
50 | user | course | role | timestart |
51 | student1 | C1 | student | 1609804800 |
52 And the following "activities" exist:
53 # The assignment's due date is 3 Jan 2021.
54 | activity | name | intro | course | idnumber | assignsubmission_onlinetext_enabled | duedate |
55 | assign | Test assignment name | Test assignment description | C1 | assign0 | 1 | 1609632000 |
56 When I log in as "student1"
57 And I am on "Course 1" course homepage
58 And I follow "Test assignment name"
59 Then the activity date in "Test assignment name" should contain "Due: Thursday, 7 January 2021, 8:00"
61 Scenario: As a teacher, I should see the relative dates when reviewing assignment submissions
62 Given the following config values are set as admin:
63 | enablecourserelativedates | 1 |
64 And the following "courses" exist:
65 | fullname | shortname | category | groupmode | relativedatesmode | startdate |
66 | Course 1 | C1 | 0 | 1 | 1 | ##first day of 4 months ago## |
67 And the following "users" exist:
68 | username | firstname | lastname | email |
69 | teacher1 | Teacher | 1 | teacher1@example.com |
70 | student1 | Student | 1 | student1@example.com |
71 | student2 | Student | 2 | student2@example.com |
72 And the following "course enrolments" exist:
73 # Two students, one started 4 months ago and one yesterday.
74 | user | course | role | timestart |
75 | teacher1 | C1 | editingteacher | ##first day of 4 months ago## |
76 | student1 | C1 | student | ##first day of 4 months ago## |
77 | student2 | C1 | student | ##yesterday## |
78 # One assignment, valid for 2 months.
79 And the following "activities" exist:
80 | activity | name | intro | course | idnumber | assignsubmission_onlinetext_enabled | timeopen | duedate |
81 | assign | Test assignment name | Test assignment description | C1 | assign0 | 1 |##first day of 4 months ago## | ##last day of 3 months ago## |
82 And I log in as "teacher1"
83 And I am on "Course 1" course homepage
84 And I follow "Test assignment name"
85 And the activity date in "Test assignment name" should contain "after course start"
86 And I should see "Calculated for each student" in the "Time remaining" "table_row"
87 When I navigate to "View all submissions" in current page administration
88 Then I should see "No submission" in the "Student 1" "table_row"
89 And I should see "Assignment is overdue by:" in the "Student 1" "table_row"
90 And I should see "No submission" in the "Student 2" "table_row"
91 And I should not see "Assignment is overdue by:" in the "Student 2" "table_row"