Skip to content

Commit

Permalink
WIP on requesting users from Canvas instead of courses
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosk committed Nov 4, 2024
1 parent 6c17049 commit eef405e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/canvaslms/cli/submissions.nw
Original file line number Diff line number Diff line change
Expand Up @@ -753,13 +753,29 @@ def resolve_grader(submission):
return "autograded"

try:
return submission.assignment.course.get_user(submission.grader_id)
<<resolve the grader's user ID from Canvas>>
except canvasapi.exceptions.ResourceDoesNotExist:
canvaslms.cli.warn(f"unknown grader {submission.grader_id} "
f"for submission {submission}.")
return f"unknown grader {submission.grader_id}"
@

The only option we have as the code is written currently, is to try to get the
user from the course ([[course.get_user]]).
But we should really get the user from a Canvas object, [[canvas.get_user]].
If using [[get_user(...)]] on a course object, then the user must exist in the
course.
However, that's not necessarily true.
So we should get it from a [[Canvas]] object, that is, from the system rather
than just the course.
But as mentioned, right now we can only do it through the course.
This isn't a problem as long as none of the teachers or teaching assistants are
removed.
<<resolve the grader's user ID from Canvas>>=
return submission.assignment.course.get_user(submission.grader_id)
@


\subsection{Rubric data}

<<add rubric assessment to output>>=
Expand Down

0 comments on commit eef405e

Please sign in to comment.