openedx / openedx/openedx-platform

XBlock Asides won't run for XBlocks that implement their own `parse_xml` method

Open
#36,576 4 comments 0 reactions 3 assignees View on GitHub

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:

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.

asides_parsing_trace.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.