openedx / openedx/openedx-platform
XBlock Asides won't run for XBlocks that implement their own `parse_xml` method
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
This means that Asides will not run for many third-party XBlocks, or even standard bundled ones like ORA that use
This came up recently in the context of VideoBlock:
- https://github.com/openedx/edx-platform/issues/36489
- https://github.com/openedx/edx-platform/pull/36500
Quoting @asadali145:
I don't have enough in-depth context of XBlock and the LMS Runtime, so my analysis might be wrong. Here are my thoughts on this:
- All of the XML import code that's also responsible for parsing the asides exists in edx-platform. Adding support to the XBlock repo is very much impossible because we don't really interact with the XBlock internals during the parsing. Some responsible classes and methods for Parsing are:
- XMLModuleStore recursively parses the XML and, in the process, calls the XMLMixin.parse_xml for all of the course blocks.
- XMLMixin.parse_xml is responsible for parsing the asides. This is one that's overridden by the Video and ORA blocks and responsible for parsing the Asides.
- ImportSystem is the runtime that is responsible for processing the XML string to XBlock.
- Adding support to LMS Runtime will require refactoring and is also complex due to the checks around the runtime type. ImportSystem is the import runtime.
- Any other approaches:
- We might be able to add some support in CourseImportManager. Saying this, I think we should have someone with more domain knowledge take a deeper look and we may find a better approach.
Also, we would like to get this PR reviewed & merged before Teak as the general fix requires more time.
I am attaching the code flow for a Problem block that is followed when parsing the Asides for a Problem Block.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.