Commit 7567e5eb by Piotr Mitros

Working snapshot. Simple get_children. get_module taken out of render_module.

parent 98d8f4b5
......@@ -18,6 +18,7 @@ from models import StudentModule
from multicourse import multicourse_settings
import courseware.modules
import courseware.content_parser as content_parser
log = logging.getLogger("mitx.courseware")
......@@ -128,14 +129,14 @@ def get_module(user, request, xml_module, module_object_preload):
smod.save()
module_object_preload.append(smod)
return (instance, smod)
return (instance, smod, module_type)
def render_x_module(user, request, xml_module, module_object_preload):
''' Generic module for extensions. This renders to HTML. '''
if xml_module==None :
return {"content":""}
(instance, smod) = get_module(user, request, xml_module, module_object_preload)
(instance, smod, module_type) = get_module(user, request, xml_module, module_object_preload)
# Grab content
content = instance.get_html()
......
......@@ -58,6 +58,7 @@ class Module(XModule):
for e in self.xmltree]
self.contents = self.rendered_children()
self.contents = [j(m) for m in self.contents]
for contents, title in zip(self.contents, titles):
contents['title'] = title
......
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