feat: add support for xblock 2
This commit is contained in:
@@ -205,7 +205,7 @@ class LearningCoreXBlockRuntime(XBlockRuntime):
|
||||
# plus some minor additional lines of code as needed.
|
||||
block = block_class.parse_xml_new_runtime(xml_node, runtime=self, keys=keys)
|
||||
else:
|
||||
block = block_class.parse_xml(xml_node, runtime=self, keys=keys, id_generator=None)
|
||||
block = block_class.parse_xml(xml_node, runtime=self, keys=keys)
|
||||
|
||||
# Update field data with parsed values. We can't call .save() because it will call save_block(), below.
|
||||
block.force_save_fields(block._get_fields_to_save()) # pylint: disable=protected-access
|
||||
|
||||
@@ -217,11 +217,11 @@ class XBlockRuntime(RuntimeShim, Runtime):
|
||||
""" Disable XBlock asides in this runtime """
|
||||
return []
|
||||
|
||||
def parse_xml_file(self, fileobj, id_generator=None):
|
||||
def parse_xml_file(self, fileobj):
|
||||
# Deny access to the inherited method
|
||||
raise NotImplementedError("XML Serialization is only supported with BlockstoreXBlockRuntime")
|
||||
|
||||
def add_node_as_child(self, block, node, id_generator=None):
|
||||
def add_node_as_child(self, block, node):
|
||||
"""
|
||||
Called by XBlock.parse_xml to treat a child node as a child block.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user