-
Notifications
You must be signed in to change notification settings - Fork 174
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
QuizSubmission update_score_and_comments doesn't seem to work #601
Comments
Two things: the endpoint expects a list of objects and you also need to include the required for s in quiz.get_submissions():
updated = [
{
'attempt': 1,
'fudge_points': 9
}
]
s.update_score_and_comments(quiz_submissions=updated) |
dang, i though i had tried that! thank you for the super quick response. that works thank you! it seems a little off to have to do the wrapping in the quiz_submissions, since that is always needed, and to add the attempt, since that is in s (the QuizSubmission object). i've put up #602 to make this a little nicer while still preserving legacy behavior. |
Yeah, there's a few places the API expects a list or dict without really being specific - the only way you can tell is based on how they note the parameters in the docs. It bit me in the but a lot when I first started. I like the idea of wrapping for people as the default in the library...curious what @Thetwam will say. Glad I could help 👍 |
Describe the bug
when i call update_score_and_comments(fudge_points=points) on a quiz submission, i get the error "missing required key :quiz_submissions" back. looking through the code it doesn't seem like the data being sent to the canvas server matches the required format: https://canvas.instructure.com/doc/api/quiz_submissions.html#method.quizzes/quiz_submissions_api.update
To Reproduce
Expected behavior
the fudge_points get set to 9
Environment information
python --version
) Python 3.10.6pip show canvasapi
) Name: canvasapi Version: 3.0.0Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: