From 8de3a9c25ad30a4e1ac5021a977d60d52e73911b Mon Sep 17 00:00:00 2001 From: Talha Date: Wed, 13 Dec 2023 18:21:56 +0500 Subject: [PATCH] docs: external LRS configuration --- README.rst | 25 +++++++++++++++++++++++-- openedx_cmi5_xblock/utils/utility.py | 5 +---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index 2df02a2..eff852b 100644 --- a/README.rst +++ b/README.rst @@ -16,7 +16,7 @@ The XBlock SDK Workbench, including this XBlock, will be available on the list o Installation for tutor ********************** -This method works with [tutor](https://github.com/overhangio/tutor). +This method works with `tutor `__. First, go to your requirements directory:: @@ -35,7 +35,7 @@ and build a new image:: In your studio, in your desired course, go to Advanced Settings and add `"openedx_cmi5_xblock"` in the Advanced Module List. -If you want to test the cmi5 content, then [here](https://github.com/overhangio/tutor) you can get a demo file to test: +If you want to test the cmi5 content, then `here `__ you can get demo files to test: Development *********** @@ -59,6 +59,27 @@ If you struggle with lms not displaying your cmi5 content in IFrame, then ``X_FR Note: This is not the best practice to develop an XBlock, but it works if you don't want to build dev image. +Advanced Configuration For External LRS +*************************************** + +The cmi5 Xblock may be configured to enable Third-party Learning Record Store to keep record of xapi statements outside of LMS. To configure that, add the following to Tutor by creating a `plugin `__:: + + hooks.Filters.ENV_PATCHES.add_item( + ( + "openedx-common-settings", + """ + XBLOCK_SETTINGS["CMI5XBlock"] = { + "ACTIVITY_PROVIDER_KEY": "", + "SECRET_KEY": "", + "EX_LRS_ENDPOINT": "/lrs//statements/" + # ... other settings + }""" + ) + ) + +Note: This method is for enabling External LRS for CMI5-Xblock in Tutor. + + Translating ************* diff --git a/openedx_cmi5_xblock/utils/utility.py b/openedx_cmi5_xblock/utils/utility.py index eaeb8d5..a0ebac2 100644 --- a/openedx_cmi5_xblock/utils/utility.py +++ b/openedx_cmi5_xblock/utils/utility.py @@ -3,13 +3,10 @@ import json import requests -from requests.auth import HTTPBasicAuth from django.core.validators import URLValidator +from requests.auth import HTTPBasicAuth from webob import Response -# USERNAME = 'uEy9xZTOzB3fEr_JY78' -# PASSWORD = 's4qMwv9fDFceov_JxOU' - def json_response(data): """Generate a JSON response."""