scheduler.deadline_manager

Handle deadline related feedback.

Module Contents

scheduler.deadline_manager.get_deadlines_between(assignment_list, start_time, end_time)

Filter the passed deadlines from the given assignment list.

Parameters
  • assignment_list (list(dict(str,int))) – List of assignments that need to be checked.

  • start_time (int) – Time that the deadline needs to have passed.

  • end_time (int) – Time that the deadline must not have passed yet.

Returns

Dictionary of all the assignments with its passed deadlines.

Return type

dict(int, (str, int))

scheduler.deadline_manager.get_assignments(course_id)

Get all assignments in the course.

Parameters

course_id (int) – Id of the course that is checked.

Returns

List of assignments.

Return type

list(dict(assignment, assignment_content))

scheduler.deadline_manager.check_assignment_completion(user_id, assignment_id, course_id)

Check whether the assignment is completed by a user.

Parameters
  • user_id (int) – The user id to check.

  • assignment_id (int) – The assignment id to check.

  • course_id (int) – Id of the course that is checked.

Returns

Whether the user has completed the assignment or not.

Return type

bool

scheduler.deadline_manager.get_users(course_id)

Get all users enrolled in a course.

Parameters

course_id (int) – Id of the course that is checked.

Returns

List of user ids.

Return type

list(int)

scheduler.deadline_manager.convert_time(due_date)

Convert time to the due_date (in seconds) to hours and minutes.

Parameters

due_date (int) – The due_date in seconds from the beginning of computers (unix-time).

Returns

Hours and seconds until due date.

Return type

tuple(int, int)

scheduler.deadline_manager.prep_late_warning(assignment_name)

Create a late warning message.

Parameters

assignment_name (str) – Name of the assignment.

Returns

A late warning message.

Return type

str

scheduler.deadline_manager.prep_early_warning(hours, minutes, assignment_name)

Create a early warning message.

Parameters
  • hours (int) – Hours until the deadline.

  • minutes (int) – Minutes until the deadline.

  • assignment_name (str) – Name of the assignment that approaches its deadline.

Returns

An early warning message.

Return type

str

scheduler.deadline_manager.notify_about_passed_deadlines(course_id)

Send a message to users that have not completed an assigment of which the deadline has passed.

Parameters

course_id (int) – The id of the to be checked course.

scheduler.deadline_manager.notify_about_upcoming_deadlines(time_to_deadline, course_id)

Send a message to users that have not completed an assignment that has a deadline passing soon.

Parameters
  • course_id (int) – The id of the checked course.

  • time_to_deadline – Time in seconds the user should be warned in advance.

scheduler.deadline_manager.send_warnings(message_list)

Send all users a deadline message.

Parameters

message_list (list(tuple(int, str))) – List of messages.