XBlock Drag-and-Drop v2
raw JSON → 5.0.6 verified Fri May 01 auth: no python
An XBlock for Open edX that provides a drag-and-drop problem type. Current version is 5.0.6, requires Python >=3.12, and supports Django 4.2 and 5.2. Release cadence is irregular, with minor patches and major version bumps aligned with platform updates.
pip install xblock-drag-and-drop-v2 Common errors
error ImportError: No module named 'drag_and_drop_v2' ↓
cause Library not installed in the Python environment
fix
Run 'pip install xblock-drag-and-drop-v2'
error RuntimeError: XBlock runtime not configured ↓
cause The XBlock runtime is missing or improperly initialized
fix
Use within an Open edX environment or mock the runtime with XBlock SDK.
error TypeError: DragAndDropBlock.__init__() got an unexpected keyword argument 'usage_id' ↓
cause Calling the constructor directly without proper XBlock initialization
fix
The block must be created via the XBlock runtime's 'runtime.construct_xblock' method.
Warnings
breaking Python 3.11 support dropped in v5.0.4; requires Python >=3.12. ↓
fix Upgrade Python to 3.12 or later.
breaking Drop of Python 3.8 in v5.0.0; also added Python 3.12 support. ↓
fix Use Python 3.9, 3.10, 3.11 (before 5.0.4), or 3.12+.
gotcha The block requires the XBlock runtime to be configured correctly. Simple imports without runtime may fail. ↓
fix Ensure the XBlock runtime is fully set up, e.g., in Open edX Studio or LMS.
Imports
- DragAndDropBlock
from drag_and_drop_v2 import DragAndDropBlock
Quickstart
from drag_and_drop_v2 import DragAndDropBlock
# The block is typically used within an Open edX course.
# Ensure that the XBlock runtime is properly configured.
print('Import successful')