This Xblock adds configurability over the original lti_consumer xblock from edx
Project description
Configurable LTI Consumer XBlock
This XBlock inherits, enhances and replaces edX LTI consumer Xblock to make available to conceptors in CMS several pre-configured versions of LTI Consumer. Configurations are stored in Django settings and pre-configured fields are no longer modifiable for a given version.
Installation
This package can be installed with pip
:
$ pip install [--process-dependency-links] configurable_lti_consumer-xblock
Note that the --process-dependency-links
pip
option is only required to
install or test this Xblock as a standalone package. If you plan to install it
in a base Open edX installation, then you can safely miss this option as the
only package dependency should already have been resolved.
Getting started
First things first, if you plan to work on the project itself, you will need to clone this repository:
$ git clone git@github.com:openfun/xblock-configurable-lti-consumer.git
Once the project has been cloned on your machine, you will need to build a custom edx-platform docker image that includes the xblock and setup a development environment that includes all required services up and running (more on this later):
$ cd xblock-configurable-lti-consumer
$ make bootstrap
If everything went well, you should now be able to access to the following services:
- Open edX LMS: http://localhost:8072
- Open edX CMS: http://localhost:8082
with the following credentials:
email: admin@foex.edu
password: openedx-rox
Developer guide
Once the project has been bootstrapped (see "Getting started" section), to start working on the project, use:
$ make dev
You can stop running services via:
$ make stop
If for any reason, you need to drop databases and start with fresh ones, use the
down
target:
$ make down
Configuration example
The below example configuration instanciates 2 xblocks.
CONFIGURABLE_LTI_CONSUMER_SETTINGS = {
"Demo": {
"display": "Demo LTI service",
"lti_passport_credentials": {
"oauth_consumer_key": "jisc.ac.uk",
"shared_secret": "secret",
},
"default_values": {
"lti_id": "Demo",
"launch_target": "iframe",
"launch_url": "http://ltiapps.net/test/tp.php",
"custom_parameters": [],
"button_text": "button",
"inline_height": 800,
"modal_height": 800,
"modal_width": 80,
"has_score": False,
"weight": 0,
"hide_launch": False,
"accept_grades_past_due": False,
"ask_to_send_username": True,
"ask_to_send_email": True
}
},
"Generic": {
"display": "Generic LTI xblock",
"default_values": {
"lti_id": "Generic",
"ask_to_send_username": True,
"ask_to_send_email": True
}
}
}
You also need to set XBLOCK_SELECT_FUNCTION setting to enforce configurable_lti_consumer endpoint over lti_consumer's one.
try:
from configurable_lti_consumer import filter_configurable_lti_consumer
XBLOCK_SELECT_FUNCTION = filter_configurable_lti_consumer
except ImportError:
pass
Studio integration
For now studio integration is made by inserting utils.configurable_xblocks
function call in edx-platform/cms/djangoapps/contentstore/views/component.py
.
It adds preconfigured xblocks to "Advanced" button and removes overridden
lti_consumer
component if it had been added to advanced modules.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for configurable_lti_consumer-xblock-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3465acb0e2ad2022b8bf8051c9408fc2ffc136ea3df7531b635dd5da61178e2f |
|
MD5 | 5f2441edd53be37aaa5a2b034ab3be45 |
|
BLAKE2b-256 | 940cffc960a040d9baeb522a79eaf4007d530b413ebea35dc9938f57680a0eb1 |
Hashes for configurable_lti_consumer_xblock-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6c9afc4f29452e74adb72acad5ef76866c6a5e83d668f0c7364ab83f3f4a674 |
|
MD5 | 2a69f12ee29901f79b46356936700c3a |
|
BLAKE2b-256 | c566e94d960e626d800a5a0b8682044c4a629346c7312d6163735f9d67da5c91 |