Grading Group

The grading group contains commands for admin grading tasks.

codepost_powertools.grading.get_ids_mapping(course, assignment, *, include_all_students=False, save_file=False, log=False)

Returns a mapping from student emails to submission ids.

If include_all_students is True, the mapping will include the entire course roster of students, so the submission id will be None if a student does not have a submission for the given assignment. Otherwise, the only students included will be those with a submission for the given assignment.

If save_file is not False, a csv file will be saved with the columns "submission_id" and "email". Since a submission may have multiple students, multiple rows may have the same "submission_id" value. Note that students without a submission do not appear in this file.

If save_file is a path, that will be used. Otherwise (if save_file is True), the default file "<OUTPUT>/ids.csv" will be used.

Parameters:
  • course (CourseArg) – The course.

  • assignment (AssignmentArg) – The assignment.

  • include_all_students (bool) – Whether to include the entire course roster of students.

  • save_file (bool or PathLike) – The csv file to save the data to.

  • log (bool) – Whether to show log messages.

Returns:

The mapping from student emails to submission ids. If there were any errors, returns an empty dict.

Return type:

Dict[str, int | None]

Raises:
  • ValueError – If the assignment does not belong to the course.

  • ValueError – If filepath is not a csv file.

New in version 0.1.0.