0

I have been trying to run a code .But i have been getting this error

Traceback (most recent call last):
File "notebook.py", line 126, in <module>
Testbook()
File "notebook.py", line 90, in init
bufferf = "%s %d credits %s Difficulty" % (question.question_id, question.credits, question.difficulty)
AttributeError: 'ShortAnswerQuestion' object has no attribute 'question_id'

I made the following changes

test=Textbook()

but still the probelm I get the same error.Even after going through the documentation the problem isn't solved.I have attached the files as well
src.zip

Attachments
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by woooee
0

There is no way to tell without code and a complete message but "AttributeError: 'ShortAnswerQuestion' object has no attribute 'question_id' " usually applies to a class (don't know if you use one or not). So instead of declaring a variable as self.question_id, it is defined as question_id and so is not a member of the class but is a member of the function that declares the variable.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.