@jhveem
I have only used the quiz API to modified an existing quiz by adding questions and then published it from within Canvas. Within the web interface, I have noticed that if the quiz is published and I go back and make substantial questions, I get warning messages and the changes aren't updated unless I click a button to save. That makes me wonder if it's the fact that it's published before I add the questions that causes the problem?
I cannot find an example right now to recreate. That means that the following is based off of knowledge and understanding of the API and how things work in general, but I have not tested it specifically with your case.
What I notice in your code is that you publish the quiz upon creation and then you add questions to it.
Have you tried creating the quiz to get a shell, adding the questions, and then edit the quiz to add the particulars, including that it is published? It may be that just the published=true is needed as part of the edit after the quiz is created, again -- I'm doing this without testing.
The "Save Quiz" button uses an internal (non-API) AJAX call, but that doesn't mean that the functionality isn't there that just updates the setting (not whether or not it is published). In other words, you may be able to just call the edit the quiz endpoint to get it working.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.