Skip to main content

HTML XBlock

CircleCI

A subclass of the new HTML XBlock that disables marking the block as completed and adds custom completion endpoint.

Introduction

This XBlock provides a newer alternative to the existing HTML XModule in edX platform as it presents a number of problems when trying to embed it in another site (in particular, it often hosts content that depends on JS globals like jQuery being present, and it allows users to include arbitrary JavaScript).

Installation

You may install XBlock-html-completable using its setup.py, or if you prefer to use pip, run:

pip install https://github.com/open-craft/xblock-html-completable

You may specify the -e flag if you intend to develop on the repo.

To enable this block type, add completable_html5 to course's advanced module list.

Development

If you're willing to develop on this repo, you need to be familiar with different technologies and the repos' dependencies. However, to make things easier to setup and to manage, there're bunch of make commands that you can use to do things faster.

Usage

To trigger the completion event, add the following code to your block:

<script>
  // Wait for the page to fully load.
  window.addEventListener('load', function () {
    document.getElementById('complete').click();
  });
</script>

Setting the requirements up

Hitting the following command will install in your python environment all the requirements you need for this project:

$ make requirements

Running tests

Tests are essential for this project to keep all its features working as expected. To check your changes you can use:

$ make test

Or if you want to check the code quality only, hit:

$ make quality

Release files for completable-html-xblock 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for completable-html-xblock 2.0.0
File Size Uploaded
completable_html_xblock-2.0.0.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for completable-html-xblock 2.0.0
File Interpreter ABI Platform
completable_html_xblock-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.4 kB

Release files / completable_html_xblock-2.0.0.tar.gz

Download URL completable_html_xblock-2.0.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fccb273902c72d9230952fcc7fa2e3d9dcc3339ec3075db23cf5215b67bb3c7a
BLAKE2b-256 checksum
How to use checksums
f955948619a1aab54d6db6be5a08b4f45af0e01fc32bc6ec4ac9fce0de604684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / completable_html_xblock-2.0.0-py3-none-any.whl

Download URL completable_html_xblock-2.0.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19c63e0e98dab9a3c9028e57f280209d2b85b7c96cda84b62003aaee8bb2e573
BLAKE2b-256 checksum
How to use checksums
d94306d01af4cb14e9ebf68ace2b946bed8741c354e94942e988ecbf58a47572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page