Commit 1d3f8f06 by Vik Paruchuri

Pass display name and content link rewriting down the chain

parent 8e7fa6c9
......@@ -137,10 +137,14 @@ class CombinedOpenEndedModule(XModule):
self.version = DEFAULT_VERSION
version_index = versions.index(self.version)
static_data = {
'rewrite_content_links' : self.rewrite_content_links,
}
self.child_descriptor = descriptors[version_index](self.system)
self.child_definition = CombinedOpenEndedV1Descriptor.definition_from_xml(etree.fromstring(definition['xml_string']), self.system)
self.child_module = modules[version_index](self.system, location, self.child_definition, self.child_descriptor,
instance_state = json.dumps(instance_state), metadata = self.metadata)
instance_state = json.dumps(instance_state), metadata = self.metadata, static_data= static_data)
def get_html(self):
return self.child_module.get_html()
......
......@@ -98,7 +98,7 @@ class CombinedOpenEndedV1Module():
css = {'scss': [resource_string(__name__, 'css/combinedopenended/display.scss')]}
def __init__(self, system, location, definition, descriptor,
instance_state=None, shared_state=None, metadata = None, **kwargs):
instance_state=None, shared_state=None, metadata = None, static_data = None, **kwargs):
"""
Definition file should have one or many task blocks, a rubric block, and a prompt block:
......@@ -136,7 +136,9 @@ class CombinedOpenEndedV1Module():
"""
self.metadata = metadata
self.display_name = metadata['display_name']
self.display_name = metadata.get('display_name', "Open Ended")
self.rewrite_content_links = static_data['rewrite_content_links']
# Load instance state
if instance_state is not None:
......@@ -188,6 +190,7 @@ class CombinedOpenEndedV1Module():
}
self.task_xml = definition['task_xml']
self.location = location
self.setup_next_task()
def get_tag_name(self, xml):
......
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