Source code for uw.local.teaching.bin.send_scheduling_rep_reminder

"""Termly scheduling request reminder for scheduling representatives.
"""
from datetime import date, timedelta

from uw.sql.wrap import open_psycopg2_db_service_cursor

from uw.local.termtools import fromCode

from ...outgoing.make_mail import mailout
from ...util.mail import odyssey_email, ro_email

from ..db.exam_print import message_to_course_staff

from ..webui.ui import format_date_helpful

[docs]def main (): cursor = open_psycopg2_db_service_cursor () term = fromCode (cursor.execute_required_value ("select uw_term_from_time (current_date + '2 months'::interval)")) admins = cursor.execute_tuples ("select distinct admin_id, admin_description from teaching_admin natural join auth_admin_personnel where role_code = 'EXAM' and current_date <@ role_effective and not auth_backup order by admin_description") day = timedelta (days=1) course_email_date = date (2021, 4, 21) course_deadline, examrep_deadline = cursor.execute_required_tuple ("select min (schedule_course_deadline) as c, min (schedule_examrep_deadline) as e from teaching_admin_term_exam_scheduler where term_id = %(term_id)s", term_id=term.code ()) for admin in admins: cursor.callproc_none ("teaching_admin_term_require", term.code (), admin.admin_id) content_lines = [ f'You are receiving this email because you are an Examination Representative for {admin.admin_description}.', '', f'It is now time to begin collecting final examination information from your instructors/coordinators for {term.description ()}. Your instructors must enter their final exam information directly into Odyssey. As always, you will monitor the progress of this by logging in to Odyssey:', '', f'https://odyssey.uwaterloo.ca/teaching/term/{term.code ()}/{admin.admin_id}/schedule-request/', '', f'Please review the “Courses with no Coordinator” list to fill in any missing instructors. On {format_date_helpful (course_email_date)} Odyssey will send emails to the instructors/coordinators asking them to fill in their final exam information. The more complete the instructor/coordinator information is before this happens, the more smoothly this process will run. Any changes can be requested through the email link located directly under the section id and number area.', '', f'We are asking that all assessment information be entered by end of day {format_date_helpful (course_deadline - day)} by yourself or the instructor/coordinator. At this time the form will close for instructors. It will remain open to you until {format_date_helpful (examrep_deadline - day)} to complete any missing requests.', '', 'PLEASE NOTE:', '', f' * The {term.seasonName ()} term will have some on-campus final examinations. Please keep this in mind when checking to ensure that your course sections are grouped together accordingly.', ' * If you have a course listed that never has a final assessment, please mark it as “no exam permanently”. This can still be changed in the future if the course material changes or the instructor decides they want a final assessment. This task should be reviewed each term for any new courses that have never been offered before.', f' * If you do not want the instructors to receive an email to submit exam information, please have your requests filled out by end of day {format_date_helpful (course_email_date - day)}.', ' * Please keep monitoring your courses to keep track of which have been submitting exam information. Odyssey will send out reminder emails to any instructors/coordinators who have not submitted a request.', ' * Please provide any missing instructors if possible.  If you do not know who the instructor will be, you will need to provide the exam information.', ' * When you open a course and it asks for a coordinator at the top of the page, you must assign one of the instructors to the course to ensure that someone will receive the email to complete the exam request.  Or, if you know the exam information you can complete the form without assigning a coordinator.', f' * Please keep in mind that instructors and exam reps can make changes as long as it is open to them.  We suggest taking your final report the morning of {format_date_helpful (examrep_deadline)}.', ' * NEW: Due to student conflicts in the Fall term, the option for the instructor to schedule their own examination for any course with a capacity more that 30 students has been removed. If there is a reason they need to schedule their own course we can certainly discuss this on a one on one request.', ' * NEW: Any instructor who has a take home assignment or examination now has the ability to choose this from the list of options and to pick a deadline date. This will replace them choosing No Final Examination as in the past. This does not mean that the Registrar’s Office will schedule the exam.  If they want a specific date and time they must choose to have the Registrar’s office schedule their exam for them.', '', 'If you have any questions regarding the preceding instructions please contact Annette Ertel via email (a3ertel@uwaterloo.ca), Skype, or Teams for clarification.', '', ] content = '\n'.join (content_lines) message = mailout (cursor, ro_email, '%s Final Examination Scheduling' % term.description (), content) message_to_course_staff (cursor, message, term.code (), admin.admin_id, ['EXAM']) message.add_recipient ('Cc', odyssey_email) message.add_recipient ('Cc', ro_email) message.done () cursor.connection.commit ()