ucfopen / canvasapi

Python API wrapper for Instructure's Canvas LMS. Easily manage courses, users, gradebooks, and more.
https://pypi.python.org/pypi/canvasapi
MIT License
554 stars 173 forks source link

setting other attributes of `QuizQuestion` resets `QuizQuestion.question_text` #579

Open dave-doty opened 1 year ago

dave-doty commented 1 year ago

Describe the bug

Setting QuizQuestion.question_type (or it appears, other attributes such as QuizQuestion.answers) resets QuizQuestion.question_text after the latter has been set.

To Reproduce

Steps to reproduce the behavior:

Get a QuizQuestion object from a course and set its question_text, then its question_type attributes using QuizQuestion.edit:

course = canvasutil.get_course(123456)
quiz = course.get_quiz(654321)
question = quiz.get_questions()[0]
question.edit({'question_text': 'new question text'})
print(question.question_text)
question.edit({'question_type': 'multiple_dropdowns_question'})
print(question.question_text)

Expected behavior

Expected output:

new question text
new question text

Actual output:

new question text
Question text

I believe "Question text" is the default value for that field.

Environment information

Additional context

Add any other context about the problem here.