Commit 83fdeea2 by Matthew Mongeau

Hookup the CourseDescriptor stuff by fixing a fewt push -f dorm issues.

parent 51092533
...@@ -42,7 +42,7 @@ class XMLModuleStore(ModuleStore): ...@@ -42,7 +42,7 @@ class XMLModuleStore(ModuleStore):
self.default_class = class_ self.default_class = class_
for course_dir in os.listdir(self.data_dir): for course_dir in os.listdir(self.data_dir):
if not os.path.isdir(course_dir): if not os.path.exists(self.data_dir + "/" + course_dir + "/course.xml"):
continue continue
self.load_course(course_dir) self.load_course(course_dir)
...@@ -50,7 +50,6 @@ class XMLModuleStore(ModuleStore): ...@@ -50,7 +50,6 @@ class XMLModuleStore(ModuleStore):
def load_course(self, course_dir): def load_course(self, course_dir):
""" """
Load a course into this module store Load a course into this module store
course_path: Course directory name course_path: Course directory name
""" """
...@@ -91,14 +90,14 @@ class XMLModuleStore(ModuleStore): ...@@ -91,14 +90,14 @@ class XMLModuleStore(ModuleStore):
module = XModuleDescriptor.load_from_xml(etree.tostring(xml_data), self, org, course, modulestore.default_class) module = XModuleDescriptor.load_from_xml(etree.tostring(xml_data), self, org, course, modulestore.default_class)
modulestore.modules[module.location] = module modulestore.modules[module.location] = module
if self.eager: if modulestore.eager:
module.get_children() module.get_children()
return module return module
system_kwargs = dict( system_kwargs = dict(
render_template=lambda: '', render_template=lambda: '',
load_item=modulestore.get_item, load_item=modulestore.get_item,
resources_fs=OSFS(self.data_dir / course_dir), resources_fs=OSFS(modulestore.data_dir / course_dir),
process_xml=process_xml process_xml=process_xml
) )
MakoDescriptorSystem.__init__(self, **system_kwargs) MakoDescriptorSystem.__init__(self, **system_kwargs)
......
...@@ -249,11 +249,11 @@ class XModuleDescriptor(Plugin): ...@@ -249,11 +249,11 @@ class XModuleDescriptor(Plugin):
rerandomize (string): When to generate a newly randomized instance of the module data rerandomize (string): When to generate a newly randomized instance of the module data
""" """
self.system = system self.system = system
self.metadata = kwargs.get('metadata', {})
self.definition = definition if definition is not None else {} self.definition = definition if definition is not None else {}
self.name = Location(kwargs.get('location')).name
self.category = Location(kwargs.get('location')).category
self.location = Location(kwargs.get('location')) self.location = Location(kwargs.get('location'))
self.metadata = kwargs.get('metadata', {}) self.name = self.location.name
self.category = self.location.category
self.shared_state_key = kwargs.get('shared_state_key') self.shared_state_key = kwargs.get('shared_state_key')
self._child_instances = None self._child_instances = None
......
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