New Quizzes API Problem

Jump to solution
balm_simon
Community Explorer

I am try to use the New Quizzes API to modify an existing quiz. For example, to remove the restrict student result view I use the following call with cURL:

curl https://domain.edu:443/api/quiz/v1/courses/51989/quizzes/1765410 -X PATCH -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -d "quiz[quiz_settings][result_view_settings][result_view_restricted]=false"

If nobody has taken the quiz yet, the call parses correctly and the restrictions are removed. However, the call also results in the quiz being unpublished. If I try on a quiz which has already been answered no changes are made with the error:

{"errors":[{"workflow_state":"Can't unpublish if there are student submissions"}]}

I can't understand why this call is causing the quiz to attempt to unpublish. Is this a bug or am I missing something? Thanks in advance if anyone has any ideas.

Labels (1)
0 Likes
1 Solution
James
Community Champion

Good catch on the results_view_settings. I didn't notice that because I was focusing on the unpublish problem. Yeah, that is problematic. It still unpublishes, even with the correct name.

Others probably know better than I do about how to report stuff. I don't have a direct line to any developers (although I never did, the person who always told me to contact him if there were problems with the API has left Instructure). I always use the Help > Report a Problem link from within Canvas. Then it goes to level 1 support who thinks I'm an idiot and eventually I'm persistent enough to get it to level 2 support where they actually look at what I wrote.

Going through your CSM is another good way.

The Live API is built off the documentation, so fixing it in the documentation should fix it in the Live API.

Generally, I avoid using New Quizzes as much as possible. The only time I really look into them is when someone else has a question about it.

View solution in original post

0 Likes