pyaota.grader.returner module

returner.py

Email graded answer sheets and exam version PDFs to students via Outlook COM automation (Windows).

pyaota.grader.returner.return_graded_exams(gradebook_paths, graded_dir, exams_dir, email_column='Username', email_suffix='@drexel.edu', subject='Your graded exam', body='Attached are your graded answer sheet and a copy of the exam you took.\\nIf you have questions about your grade, please contact your instructor.', dry_run=False, sleep_seconds=None)[source]

Email each student their graded answer sheet and exam version PDF.

Parameters:
  • gradebook_paths (List[Path | str]) – Gradebook CSVs with Student ID and email_column columns.

  • graded_dir (Path | str) – Directory containing graded_<student_id>_<version>.pdf files.

  • exams_dir (Path | str) – Directory containing exam-<version>.pdf files.

  • email_column (str) – Column name in the gradebook that holds the email (or email prefix).

  • email_suffix (str) – Suffix appended to the email column value (e.g. @drexel.edu). Set to "" if the column already contains full addresses.

  • subject (str) – Email subject line.

  • body (str) – Plain-text email body.

  • dry_run (bool) – If True, print what would be sent without actually sending.

  • sleep_seconds (Optional[float]) – Number of seconds to sleep between sending emails. If None, no delay is applied.