Make conditional module and poll modules a little easier to understand
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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='')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user