diff --git a/README.rst b/README.rst index 1b63122..3845c7b 100644 --- a/README.rst +++ b/README.rst @@ -1,29 +1,12 @@ In Video Quiz XBlock ==================== -This XBlock allows for edX components to be displayed to users inside of videos at specific time points. - -License -------- - -This software was forked from https://github.com/Stanford-Online/xblock-in-video-quiz - -All contribution made to those repositories, the last of which is tagged -`final-bsd-3c-contribution`_, are licensed by the original contributors under -the terms of the `BSD 3-Clause License`_. - -This software is now maintained for the purpose of the Open edX Project, which -licenses any further contributions to this repository under `the AGPLv3 license`_. - -.. _final-bsd-3c-contribution: https://github.com/openedx/xblock-in-video-quiz/releases/tag/final-bsd-3c-contribution -.. _BSD 3-Clause License: ./LICENSE-BSD-3c -.. _the APGLv3 license: ./LICENSE - +This XBlock allows for Open edX components to be displayed to users inside of videos at specific time points. Overview -------- -This XBlock expects to have a Video component and a Problem component +This XBlock expects to have a **Video component** and a **Problem component** added to the same Unit as itself. The XBlock is then configured (see below) to map timestamps (in seconds) @@ -43,13 +26,42 @@ Multiple timestamps can be configured per video. Installation ------------ +Tutor +***** + +To add the In Video Quiz XBlock package to Tutor, follow these steps: + +1. Add the package to the ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` using the following command: + +.. code:: bash + + tutor config save --append OPENEDX_EXTRA_PIP_REQUIREMENTS="git+https://github.com/openedx/xblock-in-video-quiz@LATEST_RELEASE" + + +5. Rebuild the Open edX image to include the new package: + + .. code:: bash + + tutor images build openedx + +6. Start or restart the Open edX platform: + + .. code:: bash + + tutor local start -d + +The In Video Quiz XBlock should now be installed and available for use in your Open edX instance. + +Other +***** + Install the requirements into the python virtual environment of your ``edx-platform`` installation by running the following command from the root folder: .. code:: bash - $ make requirements + make requirements Enabling in Studio ------------------ @@ -58,10 +70,15 @@ You can enable the In Video Quiz XBlock in Studio through the advanced settings. 1. From the main page of a specific course, navigate to - ``Settings -> Advanced Settings`` from the top menu. -2. Check for the ``advanced_modules`` policy key, and add - ``"invideoquiz"`` to the policy value list. -3. Click the "Save changes" button. + ``Settings -> Advanced Settings`` from the top menu. +2. Add the ``"invideoquiz"`` to your ``Advanced module list``. +3. Click the "**Save changes**" button. + +.. image:: ./images/advanced-settings.png + :alt: Advanced Settings + :width: 500px + :align: center + Configuration in Studio ----------------------- @@ -120,4 +137,15 @@ configuration. License ------- -The In Video Quiz XBlock is available under the AGPL Version 3.0 License. +This software was forked from https://github.com/Stanford-Online/xblock-in-video-quiz + +All contribution made to those repositories, the last of which is tagged +`final-bsd-3c-contribution`_, are licensed by the original contributors under +the terms of the `BSD 3-Clause License`_. + +This software is now maintained for the purpose of the Open edX Project, which +licenses any further contributions to this repository under `the AGPLv3 license`_. + +.. _final-bsd-3c-contribution: https://github.com/openedx/xblock-in-video-quiz/releases/tag/final-bsd-3c-contribution +.. _BSD 3-Clause License: ./LICENSE-BSD-3c +.. _the AGPLv3 license: ./LICENSE diff --git a/catalog-info.yaml b/catalog-info.yaml index 68be19a..eb86567 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -5,6 +5,6 @@ metadata: annotations: github.com/project-slug: openedx/xblock-in-video-quiz spec: - type: xblock + type: xblock lifecycle: unmaintained owner: axim-engineering diff --git a/images/advanced-settings.png b/images/advanced-settings.png new file mode 100644 index 0000000..a8b1615 Binary files /dev/null and b/images/advanced-settings.png differ diff --git a/invideoquiz/public/js/src/config.js b/invideoquiz/public/js/src/config.js index b106473..e870ed8 100644 --- a/invideoquiz/public/js/src/config.js +++ b/invideoquiz/public/js/src/config.js @@ -7,7 +7,7 @@ var InVideoQuizXBlock = InVideoQuizXBlock || {{}}; var videoId = '{video_id}'; // This is (temporary) error handling for previous-submitted invalid timemap. - try {{ + try {{ if (videoId) {{ InVideoQuizXBlock.config[videoId] = JSON.parse(`{timemap}`); }} diff --git a/invideoquiz/public/js/src/invideoquiz.js b/invideoquiz/public/js/src/invideoquiz.js index 1d893e7..a1e5470 100644 --- a/invideoquiz/public/js/src/invideoquiz.js +++ b/invideoquiz/public/js/src/invideoquiz.js @@ -89,7 +89,7 @@ function InVideoQuizXBlock(runtime, element) { } }); } - + function resizeInVideoProblem(currentProblem, dimensions) { currentProblem.css(dimensions); }