Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request users from Canvas instead of courses #193

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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