rename 'options' to the more specific 'answerOptions'
This commit is contained in:
parent
872272adb3
commit
952f2a989b
2 changed files with 9 additions and 9 deletions
|
@ -33,7 +33,7 @@ class IQuestionnaire(Interface):
|
||||||
|
|
||||||
questions = Attribute('An ordered collection of questions.')
|
questions = Attribute('An ordered collection of questions.')
|
||||||
responses = Attribute('A set of responses.')
|
responses = Attribute('A set of responses.')
|
||||||
defaultOptions = Attribute('A sequence of answer options to select from. '
|
defaultAnswerOptions = Attribute('A sequence of answer options to select from. '
|
||||||
'Default value used for questions that do not '
|
'Default value used for questions that do not '
|
||||||
'explicitly provide the values attribute.')
|
'explicitly provide the values attribute.')
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class IQuestion(Interface):
|
||||||
|
|
||||||
text = Attribute('The question asked.')
|
text = Attribute('The question asked.')
|
||||||
questionnaire = Attribute('The questionnaire this question belongs to.')
|
questionnaire = Attribute('The questionnaire this question belongs to.')
|
||||||
options = Attribute('A sequence of answer options to select from.')
|
answerOptions = Attribute('A sequence of answer options to select from.')
|
||||||
resultElements = Attribute('A mapping with result elements as keys and '
|
resultElements = Attribute('A mapping with result elements as keys and '
|
||||||
'corresponding relevance factors as values.')
|
'corresponding relevance factors as values.')
|
||||||
|
|
||||||
|
|
|
@ -32,25 +32,25 @@ class Questionnaire(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.questions = []
|
self.questions = []
|
||||||
self.responses = []
|
self.responses = []
|
||||||
self.defaultOptions = range(5)
|
self.defaultAnswerOptions = range(5)
|
||||||
|
|
||||||
|
|
||||||
class Question(object):
|
class Question(object):
|
||||||
|
|
||||||
implements(IQuestion)
|
implements(IQuestion)
|
||||||
|
|
||||||
_options = None
|
_answerOptions = None
|
||||||
|
|
||||||
def __init__(self, questionnaire, text=u''):
|
def __init__(self, questionnaire, text=u''):
|
||||||
self.questionnaire = questionnaire
|
self.questionnaire = questionnaire
|
||||||
self.resultElements = {}
|
self.resultElements = {}
|
||||||
self.text = text
|
self.text = text
|
||||||
|
|
||||||
def getOptions(self):
|
def getAnswerOptions(self):
|
||||||
return self._options or self.questionnaire.defaultOptions
|
return self._answerOptions or self.questionnaire.defaultAnswerOptions
|
||||||
def setOptions(self, value):
|
def setAnswerOptions(self, value):
|
||||||
self._options = value
|
self._answerOptions = value
|
||||||
options = property(getOptions, setOptions)
|
answerOptions = property(getAnswerOptions, setAnswerOptions)
|
||||||
|
|
||||||
|
|
||||||
class ResultElement(object):
|
class ResultElement(object):
|
||||||
|
|
Loading…
Add table
Reference in a new issue