Skip to content

Deploy and operate

  • Python 3.11 or later
  • Django 4.2 or 5.2
  • Open edX Redwood or later

The Python distribution is interactive-content-xblock; the Advanced Module List entry point is interactive_content_xblock.

Add the repository to OPENEDX_EXTRA_PIP_REQUIREMENTS:

git+https://github.com/blend-ed/interactive-content-xblock.git@master

For a repeatable production deployment, replace master with a reviewed commit or release tag. Rebuild the image and restart Open edX:

Terminal window
tutor images build openedx
tutor local restart

Enable the XBlock per course from Settings → Advanced Settings → Advanced Module List. Add interactive_content_xblock.

Treat permission to edit this XBlock as permission to execute browser code in a learner’s authenticated Open edX session. The learner view renders author HTML and CSS and runs author JavaScript in the page context; it is not an iframe sandbox.

  • Limit Studio write access to trusted course teams.
  • Review custom and AI-generated content before publishing.
  • Do not embed credentials, tokens, personal data, or untrusted third-party scripts.
  • Apply an appropriate Content Security Policy and allow-list only required external origins at the platform level.
  • Test alongside the course theme and other XBlocks for CSS and global JavaScript collisions.

The AI generation endpoint has an additional server-side Studio write-permission check. Standard Studio access control protects the settings save handler.

The XBlock stores these values in per-user state:

ValueDescription
Latest responseThe complete object most recently passed to submitInteraction().
Interaction countNumber of saved submissions.
Last interaction timeServer-side UTC timestamp for the latest submission.
Correctness and scoreLatest evaluated result.
FeedbackLatest feedback message.
View/manual completionWhether the completion-only event has already been emitted.

Course staff can use Open edX View as Specific Learner to inspect a learner’s rendered state because the block supports read-only masquerade. Use the Open edX instructor dashboard for platform-provided bulk exports.

Enable Debug Mode only while troubleshooting. Its panel is visible to staff and includes the block ID, user ID, interaction count, last interaction time, correctness, and score.

Install the checkout, add it as an Open edX image mount, and rebuild the development image:

Terminal window
cd interactive-content-xblock
pip install -e .
tutor mounts add /absolute/path/to/interactive-content-xblock

Create a local Tutor plugin in the directory printed by tutor plugins printroot:

from tutor import hooks
hooks.Filters.MOUNTED_DIRECTORIES.add_item(
("openedx", "interactive_content_xblock")
)

Then enable the plugin and start the environment:

Terminal window
tutor plugins enable mount_interactive_content_xblock
tutor images build openedx-dev
tutor dev start -d

Run the upstream test environments from the repository:

Terminal window
tox -e py312-django52
tox -e py312-django42
tox -e quality

Source and issue tracker: blend-ed/interactive-content-xblock.