Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting other attributes of QuizQuestion resets QuizQuestion.question_text #579

Open
dave-doty opened this issue Dec 28, 2022 · 0 comments
Labels

Comments

@dave-doty
Copy link

dave-doty commented Dec 28, 2022

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

  • Python version (python --version) 3.8.12
  • CanvasAPI version (pip show canvasapi) 3.0.0

Additional context

Add any other context about the problem here.

@dave-doty dave-doty added the bug label Dec 28, 2022
@dave-doty dave-doty changed the title setting QuizQuestion.question_type resets QuizQuestion.question_text setting other attributes of QuizQuestion resets QuizQuestion.question_text Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant