fix export for openassessment drafts (PLAT-249)

This commit is contained in:
Adam Palay
2014-12-05 12:51:24 -05:00
parent 3e1e4a4b25
commit bd6897894c
2 changed files with 39 additions and 0 deletions

View File

@@ -149,6 +149,10 @@ def export_to_xml(modulestore, contentstore, course_key, root_dir, course_dir):
# since export_from_xml (called by `add_xml_to_node`)
# exports a whole tree
# ensure module has "xml_attributes" attr
if not hasattr(draft_node.module, 'xml_attributes'):
draft_node.module.xml_attributes = {}
draft_node.module.xml_attributes['parent_url'] = draft_node.parent_url
parent = modulestore.get_item(draft_node.parent_location)
index = parent.children.index(draft_node.module.location)