Skip to content

Fix: Prevent Duplicate Instructions Rendering in Annotatable XBlock - #36445

Merged
kdmccormick merged 1 commit into
masterfrom
fix-annotatable
Apr 10, 2025
Merged

Fix: Prevent Duplicate Instructions Rendering in Annotatable XBlock#36445
kdmccormick merged 1 commit into
masterfrom
fix-annotatable

Conversation

@irtazaakram

Copy link
Copy Markdown
Member

Description

In the Annotatable XBlock, the <instructions> element was appearing twice in the student view:

  • Once in "annotatable-instructions" (where it should be).
  • Again in "annotatable-content" (where annotations and other content are rendered).

The _render_content method processed and rendered the entire XML data, including <instructions>, without removing it. The _extract_instructions method, which is responsible for removing <instructions>, was not called in _render_content, leading to duplication.

Before:
Screenshot 2025-03-26 at 2 38 07 PM

After:
Screenshot 2025-03-26 at 2 37 33 PM

This fix will:

  • Prevents duplicate instructions in the student view.
  • Maintains the expected behavior of showing instructions only in "annotatable-instructions".
  • No impact on existing annotation functionality.

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, and thank you for the description and screenshots.

One minor comment, then I'm happy to merge this in.

Comment thread xmodule/tests/test_annotatable_block.py Outdated
@irtazaakram
irtazaakram requested review from a team as code owners April 10, 2025 07:20
@irtazaakram
irtazaakram requested review from kdmccormick and removed request for a team April 10, 2025 07:40
@kdmccormick
kdmccormick merged commit de75c37 into master Apr 10, 2025
@kdmccormick
kdmccormick deleted the fix-annotatable branch April 10, 2025 15:01
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in Aximprovements Team Apr 10, 2025
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

farhan pushed a commit that referenced this pull request Apr 17, 2025
In the Annotatable XBlock, the <instructions> element was appearing
twice in the student view:

* Once in "annotatable-instructions" (where it should be).
* Again in "annotatable-content" (where annotations and other content are rendered).

The _render_content method processed and rendered the entire XML
data, including <instructions>, without removing it. The
_extract_instructions method, which is responsible for removing
<instructions>, was not called in _render_content, leading to
duplication.

This fix will:

* Prevents duplicate instructions in the student view.
* Maintains the expected behavior of showing instructions only in
  "annotatable-instructions".
* No impact on existing annotation functionality.
tonybusa pushed a commit to tonybusa/edx-platform that referenced this pull request Apr 23, 2025
…dx#36445)

In the Annotatable XBlock, the <instructions> element was appearing
twice in the student view:

* Once in "annotatable-instructions" (where it should be).
* Again in "annotatable-content" (where annotations and other content are rendered).

The _render_content method processed and rendered the entire XML
data, including <instructions>, without removing it. The
_extract_instructions method, which is responsible for removing
<instructions>, was not called in _render_content, leading to
duplication.

This fix will:

* Prevents duplicate instructions in the student view.
* Maintains the expected behavior of showing instructions only in
  "annotatable-instructions".
* No impact on existing annotation functionality.
UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
In the Annotatable XBlock, the <instructions> element was appearing
twice in the student view:

* Once in "annotatable-instructions" (where it should be).
* Again in "annotatable-content" (where annotations and other content are rendered).

The _render_content method processed and rendered the entire XML
data, including <instructions>, without removing it. The
_extract_instructions method, which is responsible for removing
<instructions>, was not called in _render_content, leading to
duplication.

This fix will:

* Prevents duplicate instructions in the student view.
* Maintains the expected behavior of showing instructions only in
  "annotatable-instructions".
* No impact on existing annotation functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants