Canvas POST New Quizzes using API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023
03:03 PM
I have a Python program that reads a JSON file and POSTs a new quiz (new quizzes).
quiz_items = requests.post(API_URL + "api/quiz/v1/courses/" + rc_course_id + "/quizzes/" + quiz_data['id'] + "/items/", data=open(json_file, 'rb'), headers=headersJSON)
This process works fine if the JSON file has only one quiz question, but I can't figure out how to include two+ questions in the file and the documentation doesn't state how / if an array of "item" 's can be used.
Has anyone done this?
I will create a JSON file for each question, but was hoping all the questions could be added to the course with just the one POST (above).
Has anyone done this?
I will create a JSON file for each question, but was hoping all the questions could be added to the course with just the one POST (above).
Thanks!