diff --git a/courseware/content_parser.py b/courseware/content_parser.py index 8f6482ccf0..a3143724f9 100644 --- a/courseware/content_parser.py +++ b/courseware/content_parser.py @@ -92,7 +92,8 @@ def id_tag(course): 'html':'filename', 'vertical':'id', 'tab':'id', - 'schematic':'id'} + 'schematic':'id', + 'book' : 'id'} # Tag elements with unique IDs elements = course.xpath("|".join(['//'+c for c in default_ids])) @@ -143,7 +144,7 @@ def course_file(user): filename = UserProfile.objects.get(user=user).courseware data_template = template_lookup.get_template(filename) - options = {'dev_content':True} + options = {'dev_content':settings.DEV_CONTENT} tree = etree.XML(data_template.render(**options)) id_tag(tree) diff --git a/courseware/management/commands/check_course.py b/courseware/management/commands/check_course.py index 7ca8ef8242..b020529ffb 100644 --- a/courseware/management/commands/check_course.py +++ b/courseware/management/commands/check_course.py @@ -41,6 +41,7 @@ class Command(BaseCommand): if os.path.exists(sections_dir): print "Checking all section includes are valid XML" for f in os.listdir(sections_dir): + print f etree.parse(sections_dir+'/'+f) else: print "Skipping check of include files -- no section includes dir ("+sections_dir+")" diff --git a/courseware/module_render.py b/courseware/module_render.py index 3c863684be..5c1c136155 100644 --- a/courseware/module_render.py +++ b/courseware/module_render.py @@ -30,6 +30,7 @@ import courseware.modules.capa_module import courseware.modules.html_module import courseware.modules.schematic_module import courseware.modules.seq_module +import courseware.modules.template_module import courseware.modules.vertical_module import courseware.modules.video_module @@ -44,6 +45,9 @@ modx_modules={'problem':courseware.modules.capa_module.LoncapaModule, 'tab':courseware.modules.seq_module.SequentialModule, 'schematic':courseware.modules.schematic_module.SchematicModule} +for f in os.listdir(settings.DATA_DIR+'/custom_tags'): + modx_modules[f] = courseware.modules.template_module.TemplateModule + def object_cache(cache, user, module_type, module_id): # We don't look up on user -- all queries include user # Additional lookup would require a DB hit the way Django