Commit f0bc0a82 by Valera Rozuvan

Merge branch 'feature/alex/poll-storage-model' of github.com:MITx/mitx into…

Merge branch 'feature/alex/poll-storage-model' of github.com:MITx/mitx into feature/alex/poll-storage-model
parents f49db1df 1c56d1c1
...@@ -77,15 +77,17 @@ class ConditionalModule(XModule): ...@@ -77,15 +77,17 @@ class ConditionalModule(XModule):
if callable(attr): if callable(attr):
attr = attr() attr = attr()
return xml_value == str(attr) if xml_value != str(attr):
break
else:
return True
return False return False
def get_html(self): def get_html(self):
return self.system.render_template('conditional_ajax.html', { return self.system.render_template('conditional_ajax.html', {
'element_id': self.location.html_id(), 'element_id': self.location.html_id(),
'id': self.id, 'id': self.id,
'ajax_url': self.system.ajax_url, 'ajax_url': self.system.ajax_url
'passed': json.dumps(self.is_condition_satisfied())
}) })
def handle_ajax(self, dispatch, post): def handle_ajax(self, dispatch, post):
......
<div id="conditional_${element_id}" class="conditional-wrapper" data-problem-id="${id}" data-url="${ajax_url}" <div id="conditional_${element_id}" class="conditional-wrapper" data-problem-id="${id}" data-url="${ajax_url}"></div>
data-passed="${passed}"></div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment