Skip to content

[Refactor] Slash-n-Burn Problem BuiltIn XBlock #540

Open
openedx/openedx-platform
#38751

Description

@irfanuddinahmad

See parent epic: openedx/openedx-platform#37819


Rollout Position

Step 8 of 8 — Largest and highest-risk block (~15K LOC). The Problem/CAPA block is deeply integrated with the grading system and instructor dashboard, and supports many problem types (multiple choice, code input, circuit schematic, MATLAB, image input). Leave this for last.


Block Details

Toggle USE_EXTRACTED_PROBLEM_BLOCK in openedx/envs/common.py
Shim class _BuiltInProblemBlock in xmodule/capa_block.py
Entrypoint problem = "xmodule.capa_block:ProblemBlock" in pyproject.toml

Note on stale annotation: The toggle annotation in openedx/envs/common.py still says toggle_default: False but the code has been set to True (via refactor: Enable Extracted Problem XBlock #38152). The PR for this block should update the annotation to toggle_default: True before removing the toggle entirely.


Checklist

Pre-condition

  • Review PRs merged into the built-in Problem XBlock code in edx-platform after the extraction work was done — port any bug fixes or improvements to xblocks-contrib if not already there.
  • Confirm all problem types (multiple choice, code input, circuit schematic, MATLAB, image input) work correctly in xblocks-contrib.
  • Confirm grading pipeline integration is unaffected.

Steps (single PR)

  • Fix stale annotation — update # .. toggle_default: False → # .. toggle_default: True at openedx/envs/common.py before removing the toggle.
  • Remove the toggle — delete USE_EXTRACTED_PROBLEM_BLOCK from openedx/envs/common.py and all usages.
  • Remove the shim — delete _BuiltInProblemBlock class and the from xblocks_contrib.problem import ProblemBlock as _ExtractedProblemBlock import from xmodule/capa_block.py.
  • Re-point the entrypoint — change problem = "xmodule.capa_block:ProblemBlock" in pyproject.toml to problem = "xblock_problem:ProblemBlock". The name problem stays in the platform, because xblocks-core only registers _problem_extracted (for testing).
  • Remove remaining assets:
    • xmodule/capa_block.py (Python class, 2,481 LOC)
    • xmodule/js/src/capa/ (display.js, imageinput.js, schematic.js — 7,759 LOC)
    • xmodule/static/css-builtin-blocks/ProblemBlockDisplay.css (2,304 LOC)
    • xmodule/templates/problem/ (template files)
    • Webpack entries ProblemBlockDisplay / ProblemBlockEditor in webpack.builtinblocks.config.js
  • Run smoke tests on the extracted Problem block covering all problem types and grading scenarios.

Activity

  1. irfanuddinahmad commented on Jun 11, 2026

    @irfanuddinahmad
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions