Quizzes: How to add file to file upload question using the API

agschmid
Community Contributor

I'm trying to figure out if it's possible to add a file to a file upload question in quizzes. 

I tested with assignments first (because it was a lot easier!) and the process requires many steps, with the last being that after the file was uploaded to the user's files, sending the file id in the assignment submission.

For quizzes, I've done the file upload and it's in the user's files, then I attempted to actually "take" the quiz through the api. I got as far as /api/v1/courses/:course_id/quizzes/:quiz_id/submissions/questions.

I have found all the other question types and what to add to the json body except for the file upload question:

Quiz Submission Questions - Canvas LMS REST API Documentation 

I was hoping I could just add the ID for the file as I did in assignments, but that doesn't work.

Has anyone been successful at adding a file (as the student) from the user's files to a quiz file upload question?

0 Likes