Make conditional module and poll modules a little easier to understand

This commit is contained in:
Calen Pennington
2013-12-18 16:18:03 -05:00
parent 268c4fa01b
commit 06fadcdc0c
2 changed files with 7 additions and 1 deletions

View File

@@ -96,7 +96,11 @@ class ConditionalModule(ConditionalFields, XModule):
xml_value = self.descriptor.xml_attributes.get(xml_attr)
if xml_value:
return xml_value, attr_name
raise Exception('Error in conditional module: unknown condition "%s"' % xml_attr)
raise Exception(
'Error in conditional module: no known conditional found in {!r}'.format(
self.descriptor.xml_attributes.keys()
)
)
@lazy
def required_modules(self):

View File

@@ -32,7 +32,9 @@ class PollFields(object):
poll_answer = String(help="Student answer", scope=Scope.user_state, default='')
poll_answers = Dict(help="All possible answers for the poll fro other students", scope=Scope.user_state_summary)
# List of answers, in the form {'id': 'some id', 'text': 'the answer text'}
answers = List(help="Poll answers from xml", scope=Scope.content, default=[])
question = String(help="Poll question", scope=Scope.content, default='')