Skip to main content

A custom HTML XBlock that can only be marked as completed by calling a custom completion endpoint.

Project description

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.

Note that as of version 1.0.0, Python 2.7 is no longer supported. The current minimum Python version is 3.8.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

completable-html-xblock-1.2.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

completable_html_xblock-1.2.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file completable-html-xblock-1.2.2.tar.gz.

File metadata

File hashes

Hashes for completable-html-xblock-1.2.2.tar.gz
Algorithm Hash digest
SHA256 b48206bf56133be50795b0a5a7578eadfc02319e99e4a703a37334b314dea99b
MD5 1448ff7e3070cf85a4e1af88ce150a22
BLAKE2b-256 8a07579f1f486c6d9cb9749e438c28d0d8ccc083d91766ae0543793b469061e6

See more details on using hashes here.

File details

Details for the file completable_html_xblock-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for completable_html_xblock-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfd01b200d865daf808d23f37ddc70f9ad0179d16de59ccd1168121c969aa966
MD5 efbe3eb8571e1742395c16344f48cd3a
BLAKE2b-256 d47a4d6e84e9f78653984c1c8391ca07aa7dd2d296681c9bcceef6444e1a3192

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page