Show
Test set up:
A series of users, all in the same timezone. If you use 'mdk run users' then this should already be the case.
Enable course relative dates on your site, via the site admin (enablecourserelativedates).
Create a course, setting the following:
Relative dates mode to enabled.
Course start date to 7 days ago, midnight. Remember this date.
Course end date disabled.
Enable the self enrolment method on this course.
Login as student 2 (s2).
Self enrol in the course.
Testing the submission and grading views.
Login as the admin
Enrol t1 in the course as a teacher.
Enrol s1, s2 and s3 in the course as students. You will now have 2 enrolments for s2 and this is expected.
Edit the enrolment for t1 and set the start date to 6 days ago, midnight (day after the course start date).
Edit the enrolment for s1 and set the start date to 7 days ago, midnight (on the course start date).
Edit the manual enrolment for s2 (check that it's the manual enrolement!) and set the start date to 8 days ago, midnight (before the course start date).
Edit the enrolment for s3 and set the start date to 2 days ago, midnight (5 days after course start).
Log out
Log in as the teacher.
Create an assignment in the course with a due date of 3 days ago, midnight (students will have 4 days to complete this assignment from when they start the course). Make sure the cut-off date is disabled and that the allow submissions from date is set to the course start date.
Click the assignment to view it.
Verify the grading summary view contains the following changes:
Due date reads '4d 0h 0m after course start'.
Time remaining reads 'Calculated for each student'.
Click 'View all submissions'
Verify the folowing:
That you see an 'Assignment is overdue' message in the status column of the s1 and s2 rows.
That you don't see the 'Assignment is overdue' message in the status column of the s3 row.
That you see the 'due date', 'cut-off date' and 'allow submissions from date' columns in the table
That the due date for s3 is listed as 2 days from now (they started 2 days ago and have 2 more days to complete the assignment)
That the due date for s1 and s2 are listed as 4 days after the course start date.
Log out
Log in as s1
Go to the assignment
Verify you see a due date 4 days after the start of the course (3 days ago), midnight.
Verify time remaining reads "Assignment is overdue by 3 days xx hours"
Submit something and wait on the post-submission screen
Verify you see "Assignment was submitted 3 days xxx hours late"
Verify the due date is listed as 4 days after the start of the course (3 days ago), midnight.
Log out
Log in as s2
Go to the assignment
Verify you see a due date 4 days after the start of the course (3 days ago), midnight.
Verify time remaining reads "Assignment is overdue by 3 days xx hours"
Don't submit anything.
Log out.
Log in as s3
Go to the assignment
Verify you see a due date 2 days from now, midnight.
Verify time remaining reads "1 days xx hours"
Add a submission and wait on the post-submission screen
Verify you see "Submitted for grading"
Verify time remaining reads "1 days xx hours"
Verify the due date is listed as 2 days from now, midnight.
Log out.
Log in as the teacher
Go to the course and view the assignment
Click 'View all submissions'
Verify the following:
That s3 is listed with status 'Submitted for grading'
That s1 is listed with status 'Submitted for grading' with a red info box containing "3 days xx hours late"
That s2 is listed with status 'No submission' with red text reading "Assignment is overdueby: 3 days xx hours"
Click the due date column to sort by that column.
Verify this works. Try it a few times for different sort directions and confirm both work.
Click 'Grade' for s3
Verify the following:
Due date in the central header is listed as 2 days from today, midnight.
Under submission details, on the right, you see '1 day xx hours remaining'
Change user (using the next/prev controls in the top right) to s1
Verify the following:
Due date in the central header is listed as 4 days after the start of the course (3 days ago), midnight.
Under submission details, on the right, you see 'Assignment was submitted 3 days xx hours late'
Change user (using the next/prev controls in the top right) to s2
Verify the following:
Due date in the central header is listed as 4 days after the start of the course (3 days ago), midnight.
Under submission details, on the right, you see 'Assignment is overdue by: 3 days xx hours'
Regression test for non-relative dates assignments/courses
Create a course with relative dates mode set to disabled.
Set the course start date to 7 days ago
Create an assignment with a due date set to 3 days ago
Enrol 3 students, and edit their enrolment start dates to:
s1: 7 days ago, midnight
s2: 8 days ago, midnight
s3: 6 days ago, midnight
Enrol a teacher and edit their enrolment start date to:
t1: 7 days ago, midnight
Log out
Log in as the teacher
View the assignment
Verify that the due date is a specific date
Verify that the time remaining is a specific time
Click 'View all submissions'
Verify the following:
The due date column is not shown, nor is the cutoffdate or allowsubmissions from
Go back to the assignment main page
Create a user override (from the cog menu) for a single user (any one)
Now, go back to the 'view all submissions' page
Verify the following:
The due date, cutoffdate and allowsubmissions cols are present
The due date for all users is the same.