You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a documented issue with the Canvas API (not the Python module) making quizzes being in an unsaved stated after creation. This results in the instructor having to manually save quizzes from the user interface so that students can see the questions. Supposedly triggering an edit using quiz.edit() should fix the issue but doesn't seem to work.
With the canvasapi python module, I can create quizzes, but I can't edit them after creation.
To Reproduce
from canvasapi import Canvas
url = "<uni_url_here>"
key = "<key_here>"
course_id = "<course_id_here>"
canvas = Canvas(url, key)
course = canvas.get_course(course_id)
attendance_question = {
'question_name': 'standard_quiz_question',
'question_text': 'Respond to something from class today! You can make a comment or ask a question. This should be 1-2 sentences.',
'points_possible': 10,
'question_type': 'essay_question',
}
for i in range(1):
# create quiz item here
quiz = course.create_quiz(quiz={
'title': 'Reflection {}'.format(class_period_labels[i]),
'quiz_type' : 'graded_survey',
'description': '',
'points_possible': 10,
'access_code' : 123,
'published' : False,
'notify_of_update' : False
})
# add question to it here
question = quiz.create_question(question=attendance_question)
# the question has been added but this doesn't work; the quiz remains unpublished
quiz.edit(published=True)
The quiz remains unpublished. If I initially set the quiz to published, I see this in Canvas:
"You have made changes to the questions in this quiz.
These changes will not appear for students until you save the quiz. "
Expected behavior
The quiz should publish using the Canvas API. I can publish it manually with curl:
Describe the bug
There's a documented issue with the Canvas API (not the Python module) making quizzes being in an unsaved stated after creation. This results in the instructor having to manually save quizzes from the user interface so that students can see the questions. Supposedly triggering an edit using
quiz.edit()
should fix the issue but doesn't seem to work.With the canvasapi python module, I can create quizzes, but I can't edit them after creation.
To Reproduce
The quiz remains unpublished. If I initially set the quiz to published, I see this in Canvas:
"You have made changes to the questions in this quiz.
These changes will not appear for students until you save the quiz. "
Expected behavior
The quiz should publish using the Canvas API. I can publish it manually with curl:
Environment information
The text was updated successfully, but these errors were encountered: