From 06fadcdc0c639d32f15c472e9e5eb48b5ba5f3a5 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 18 Dec 2013 16:18:03 -0500 Subject: [PATCH] Make conditional module and poll modules a little easier to understand --- common/lib/xmodule/xmodule/conditional_module.py | 6 +++++- common/lib/xmodule/xmodule/poll_module.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/conditional_module.py b/common/lib/xmodule/xmodule/conditional_module.py index 8248343371..48872b5393 100644 --- a/common/lib/xmodule/xmodule/conditional_module.py +++ b/common/lib/xmodule/xmodule/conditional_module.py @@ -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): diff --git a/common/lib/xmodule/xmodule/poll_module.py b/common/lib/xmodule/xmodule/poll_module.py index 86852cd698..47b65fe892 100644 --- a/common/lib/xmodule/xmodule/poll_module.py +++ b/common/lib/xmodule/xmodule/poll_module.py @@ -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='')