Activity Feed
- Posted Re: Canvas API call to update an existing quiz question fails with error 500 on Canvas Developers Group. 03-02-2023 02:02 PM
- Got a Like for Re: Canvas API call to update an existing quiz question fails with error 500. 02-23-2023 10:51 AM
- Posted Re: Canvas API call to update an existing quiz question fails with error 500 on Canvas Developers Group. 02-23-2023 10:46 AM
- Posted Re: Quiz Submission Questions API Not Returning 'answer' for Multiple Choice Question on Canvas Developers Group. 12-16-2022 12:44 PM
- Got a Like for Re: Using API endpoints for Quizzes. 05-19-2022 12:30 PM
- Posted Re: Using API endpoints for Quizzes on Canvas Developers Group. 05-19-2022 11:46 AM
- Posted Re: Using API endpoints for Quizzes on Canvas Developers Group. 05-11-2022 11:51 AM
- Posted Using API endpoints for Quizzes on Canvas Developers Group. 05-10-2022 01:27 PM
- Liked Re: null access_token for javierht. 02-24-2022 12:37 PM
My Posts
Post Details | Date Published | Views | Likes |
---|---|---|---|
Using API endpoints for Quizzes I am developing an external app that starts a quiz, retrieves the questions, then saves/updates the responses, and finally, completes the quiz, using various API Endpoints. There does not appea... |
05-10-2022 |
1313 |
0 |
03-02-2023
02:02 PM
Just a wild guess, but the id of the answer has a decimal point. This seems inappropriate.
... View more
02-23-2023
10:46 AM
2 Likes
It looks like the answer object has an issue: the name of the answer is "answer_text" not "text".
... View more
12-16-2022
12:44 PM
Not sure if this helps or not, as I'm very new to Canvas, and am not familiar with practice quiz. That said, if the practice quiz requires that you start a quiz submission with the endpoint POST /api/v1/courses/:course_id/quizzes/:quiz_id/submissions, then the endpoint will return a quizSubmission object with a key named validation_token. This token is used as a parameter to the endpoint GET /api/v1/quiz_submissions/:quiz_submission_id/questions?validation_token=:validation_token, which will then return a QuizSubmissionQuestion object with an answer key (instead of the correct key). Hope this helps.
... View more
05-19-2022
11:46 AM
1 Like
Using the "id" of the quiz submission object did the trick. In looking at the JSON returned from quiz submissions - {"quiz_id":216962,"id":1144880,"submission_id":8605758,...- I was using the "submission_id" and not the "id". The documentation of the Quiz Submission object doesn't do much to explain the difference between the two. Thank you VERY much for your help!
... View more
05-11-2022
11:51 AM
Thanks for the quick response... To answer your questions - The test student has not taken the quiz. However, my app is set up to 'start' a quiz automatically, if one is not already started. I've tried 3 different variations of the request to list questions in a quiz; each is a failure. courseID is 552 quizID is 216962 submissionID is 8605758 attempt is 1 Attempt 1 - no arguments for submission ID or attempt <cfhttp method="GET" url="#get( 'canvasURL' )#/api/v1/courses/#arguments.courseID#/quizzes/#arguments.quizID#/questions" result="local.result"> <cfhttpparam type="HEADER" name="Authorization" value="Bearer #arguments.access_token#" /> </cfhttp> {"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]} The error detail is 401 Unauthorized Attempt 2 - arguments for submission ID and attempt in the request body <cfhttp method="GET" url="#get( 'canvasURL' )#/api/v1/courses/#arguments.courseID#/quizzes/#arguments.quizID#/questions" result="local.result"> <cfhttpparam type="HEADER" name="Authorization" value="Bearer #arguments.access_token#" /> <cfhttpparam type="BODY" name="quiz_submission_id" value="#arguments.quizSubmissionID#" /> <cfhttpparam type="BODY" name="quiz_submission_attempt" value="#arguments.quizSubmissionAttempt#" /> </cfhttp> {"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]} The error detail is 401 Unauthorized Attempt 3 - arguments for submission ID and attempt in the request URL <cfhttp method="GET" url="#get( 'canvasURL' )#/api/v1/courses/#arguments.courseID#/quizzes/#arguments.quizID#/questions" result="local.result"> <cfhttpparam type="HEADER" name="Authorization" value="Bearer #arguments.access_token#" /> <cfhttpparam type="URL" name="quiz_submission_id" value="#arguments.quizSubmissionID#" /> <cfhttpparam type="URL" name="quiz_submission_attempt" value="#arguments.quizSubmissionAttempt#" /> </cfhttp> {"errors":[{"message":"The specified resource does not exist."}]} The error detail is 404 Not Found
... View more
05-10-2022
01:27 PM
I am developing an external app that starts a quiz, retrieves the questions, then saves/updates the responses, and finally, completes the quiz, using various API Endpoints. There does not appear to be any type of workflow documentation for this process, so my methodology is basically to "try this and see what happens". For all the following, Shibboleth authentication is used, and an OAuth2 workflow is completed successfully. Using my personal credentials as an administrator, I am able to list quizzes in a course, create a quiz submission for a quiz in a course, and get Quiz Questions for a specific quiz in a course (GET /api/v1/courses/:courseID/quizzes/:quizID/questions) Using a test student account, I am able to list quizzes in a course, create a quiz submission for a quiz in a course, and I am unable to get Quiz Questions for a specific quiz in a course. The response is {"status":"unauthorized","errors":[{"message":"user not authorized to perform that action"}]} The have several questions: Is there some workflow-type documentation that describes how the various endpoints should be used? Am I using the correct endpoint for the student to retrieve the quiz qestions? Are there (script) examples of this process that anyone is willing to share from which I can learn? Thanks for any and all feedback!
... View more
Labels
- Labels:
-
APIs & Scripting