Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/quizdata/question.py
diff options
context:
space:
mode:
Diffstat (limited to 'quizdata/question.py')
-rw-r--r--quizdata/question.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/quizdata/question.py b/quizdata/question.py
index 0e3469c..3350cd7 100644
--- a/quizdata/question.py
+++ b/quizdata/question.py
@@ -52,7 +52,7 @@ class Question(object):
self.markup_type = str
if 'text' in kwargs:
- self.title = self.markup_type(kwargs['text'])
+ self.text = self.markup_type(kwargs['text'])
else:
raise Exception("Questions must have text!")
@@ -106,7 +106,9 @@ class MultipleChoiceQuestion(Question):
@property
def correct(self):
- return self.answer == self._correct:
+ #print "DEBUG: self.answer: ", self.answer
+ #print "DEBUG: self._correct: ", self._correct
+ return self.answer == self._correct
class TrueFalseQuestion(MultipleChoiceQuestion):
@@ -114,6 +116,12 @@ class TrueFalseQuestion(MultipleChoiceQuestion):
kwargs['answers'] = ['True', 'False']
super(TrueFalseQuestion, self).__init__(*args, **kwargs)
+ @property
+ def correct(self):
+ print "DEBUG: self.answer: ", self.answer
+ print "DEBUG: self._correct: ", self._correct
+ return self.answer.lower().startswith(self._correct.lower()) #XXX: hack?
+
#### XXX: The below classes aren't completely implemented. ####