Commit 84d8a7fe by Alexander Kryklia

sending message to the js

parent 18c74afa
...@@ -96,11 +96,13 @@ class ConditionalModule(XModule): ...@@ -96,11 +96,13 @@ class ConditionalModule(XModule):
an AJAX call. an AJAX call.
""" """
if not self.is_condition_satisfied(): if not self.is_condition_satisfied():
message = self.descriptor.xml_attributes.get('message')
context = {'module': self, context = {'module': self,
'message': self.descriptor.xml_attributes.get('message')} 'message': message}
html = self.system.render_template('conditional_module.html', html = self.system.render_template('conditional_module.html',
context) context)
return json.dumps({'html': [html], 'passed': False}) return json.dumps({'html': [html], 'passed': False,
'message': bool(message)})
if self.contents is None: if self.contents is None:
self.contents = [self.system.get_module(child_descriptor.location self.contents = [self.system.get_module(child_descriptor.location
......
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