You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to then PUT this data up to Canvas will generate the error: UnprocessableEntity: {"errors":{"scoring_data":["Invalid Scoring Data: The property '#/values/0/points' of type string did not match the following type: number"]},"message":"Unprocessable Entity"}
This seems to be a case where it is much simpler to just send a dictionary directly, and I see that the request method has a json keyword, but it looks like setting this to True, doesn't actually allow you to send a data dictionary as _kwargs is still expected to be a list of tuples. Is there any way to make this work with the canvasapi requester, or is this a case where just manually assembling the request is the best way to go?
Describe the bug
I'm working with the new quiz items API (https://canvas.instructure.com/doc/api/new_quiz_items.html) and have run into an issue where it appears that the structure of canvasapi's request class is incompatible with this endpoint.
Specifically, the
scoring_data
dictionary for the multiple choice with varying point values by answer item type (https://canvas.instructure.com/doc/api/new_quiz_items.html#choice) requires an internal list of dictionaries, e.g.:If you run this through
combine_kwargs
you'll get something like:Trying to then PUT this data up to Canvas will generate the error:
UnprocessableEntity: {"errors":{"scoring_data":["Invalid Scoring Data: The property '#/values/0/points' of type string did not match the following type: number"]},"message":"Unprocessable Entity"}
This seems to be a case where it is much simpler to just send a dictionary directly, and I see that the
request
method has a json keyword, but it looks like setting this to True, doesn't actually allow you to send a data dictionary as_kwargs
is still expected to be a list of tuples. Is there any way to make this work with the canvasapi requester, or is this a case where just manually assembling the request is the best way to go?To Reproduce
Minimal worked example:
Expected behavior
Setting up the request manually works as expected:
Environment information
Additional context
Thanks!
The text was updated successfully, but these errors were encountered: