Commit d387843c by Calen Pennington

Fixing up check_course to pull in modules correctly

parent 1652ec38
...@@ -6,9 +6,9 @@ from django.core.management.base import BaseCommand ...@@ -6,9 +6,9 @@ from django.core.management.base import BaseCommand
from django.conf import settings from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from mitx.courseware.content_parser import course_file from courseware.content_parser import course_file
import mitx.courseware.module_render import courseware.module_render
import mitx.courseware.modules import courseware.modules
class Command(BaseCommand): class Command(BaseCommand):
help = "Does basic validity tests on course.xml." help = "Does basic validity tests on course.xml."
...@@ -25,15 +25,15 @@ class Command(BaseCommand): ...@@ -25,15 +25,15 @@ class Command(BaseCommand):
check = False check = False
print "Confirming all modules render. Nothing should print during this step. " print "Confirming all modules render. Nothing should print during this step. "
for module in course.xpath('//problem|//html|//video|//vertical|//sequential|/tab'): for module in course.xpath('//problem|//html|//video|//vertical|//sequential|/tab'):
module_class=mitx.courseware.modules.modx_modules[module.tag] module_class = courseware.modules.modx_modules[module.tag]
# TODO: Abstract this out in render_module.py # TODO: Abstract this out in render_module.py
try: try:
instance=module_class(etree.tostring(module), module_class(etree.tostring(module),
module.get('id'), module.get('id'),
ajax_url='', ajax_url='',
state=None, state=None,
track_function = lambda x,y,z:None, track_function = lambda x,y,z:None,
render_function = lambda x: {'content':'','destroy_js':'','init_js':'','type':'video'}) render_function = lambda x: {'content':'','destroy_js':'','init_js':'','type':'video'})
except: except:
print "==============> Error in ", etree.tostring(module) print "==============> Error in ", etree.tostring(module)
check = False check = False
......
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