Hi Im using canvas API trying to create a "File" module item (sometimes called "Dropbox") where student can both download some file to edit, and then upload up there edited file (the file is probably some quiz)
So I see that module item has. "File" type - I suspect thats what I want. Then the question is what to use for "content" - to then put in as "content_id". Folder seemed like the obvious choice. But when I created a folder and put the folders id in as the content id in my File module item I get the unfortunately not very informative (dreaded) error:
Solved! Go to Solution.
Hello @mgibson2 thanks for posting in the community.
I understand that we are updating information in Modules via the API and I want to help clarify.
It sounds like your second post is more close to what you want, and it sounds like you were creating a file upload question within a quiz via API. This is what that API call looks like: https://canvas.instructure.com/doc/api/quiz_questions.html#method.quizzes/quiz_questions.create
However, I would advise to use the Assignment Item type instead of Quizzes. Manipulating the Assignment API would be much easier than trying to create each individual quiz question via API. https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.create
If you are creating an Assignment via Modules, we would refer to the create module item API:
https://canvas.instructure.com/doc/api/modules.html#method.context_module_items_api.create
That would be the API for creating an Assignment, which is the basic item for allowing students to upload their Files into a dropbox for you to grade. What are Assignments? (guide)
You would want to specify that Assignment to be online_upload if you are wanting to have your students be able to upload files into that Assignment.
Hope this helps!
I should be more clear about the quiz that worked - what works is if i create a module item of type "Quiz" (not File) and then link in a quiz that has a question of type "file_upload_question". And that all works - and seems to more or less be a dropbox - however that dropbox looks different than the dropbox from common cartridge - so Im guessing theres another way to go about this? I thought it might be the File type - but cant get that to work - the api docs lack documentation on how one pieces this stuff together - or if theres such docs would love to hear about that - thanks for help - mark
Hello @mgibson2 thanks for posting in the community.
I understand that we are updating information in Modules via the API and I want to help clarify.
It sounds like your second post is more close to what you want, and it sounds like you were creating a file upload question within a quiz via API. This is what that API call looks like: https://canvas.instructure.com/doc/api/quiz_questions.html#method.quizzes/quiz_questions.create
However, I would advise to use the Assignment Item type instead of Quizzes. Manipulating the Assignment API would be much easier than trying to create each individual quiz question via API. https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.create
If you are creating an Assignment via Modules, we would refer to the create module item API:
https://canvas.instructure.com/doc/api/modules.html#method.context_module_items_api.create
That would be the API for creating an Assignment, which is the basic item for allowing students to upload their Files into a dropbox for you to grade. What are Assignments? (guide)
You would want to specify that Assignment to be online_upload if you are wanting to have your students be able to upload files into that Assignment.
Hope this helps!