diff --git a/.gitmodules b/.gitmodules index 0b07f19..4a0083d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "book/external/Download-Link-Replacer"] path = book/external/Download-Link-Replacer url = https://github.com/TeachBooks/Download-Link-Replacer.git +[submodule "book/external/Sphinx-Grasple-public"] + path = book/external/Sphinx-Grasple-public + url = https://github.com/TeachBooks/Sphinx-Grasple-public.git diff --git a/book/_config.yml b/book/_config.yml index 5340e4a..16a68fb 100644 --- a/book/_config.yml +++ b/book/_config.yml @@ -22,6 +22,7 @@ sphinx: - sphinx.ext.imgconverter - download_link_replacer - jupyterbook_patches + - teachbooks_sphinx_grasple config: html_js_files: - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js diff --git a/book/_toc.yml b/book/_toc.yml index 85cba5c..4985e92 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -49,7 +49,7 @@ parts: - file: external/JupyterBook-Patches/README.md - file: features/interactive_element.ipynb sections: - - file: features/grasple.md + - file: external/Sphinx-Grasple-public/README.md - file: features/h5p.md - file: features/HTML_javascript.md sections: diff --git a/book/external/Sphinx-Grasple-public b/book/external/Sphinx-Grasple-public new file mode 160000 index 0000000..6e7b6b6 --- /dev/null +++ b/book/external/Sphinx-Grasple-public @@ -0,0 +1 @@ +Subproject commit 6e7b6b681a2167f46fef9c02ae3feeaa12e6506a diff --git a/book/features/grasple.md b/book/features/grasple.md deleted file mode 100644 index 038f7d3..0000000 --- a/book/features/grasple.md +++ /dev/null @@ -1,70 +0,0 @@ -# Grasple questions - -```{admonition} User types -:class: tip -This section is useful for user type 3-5. -``` - -[Grasple](https://app.grasple.com/) gives you an embed code for each exercise which looks like this, which can be added cirectly to your markdown-file. -```html - -``` - -The embed link is created for an exercise under 'More'- 'Embed Exercise' - -This iframe can be embedded into your Jupyter book. - -```{admonition} Note -:class: tip -This feature doesn't display in a book that is viewed locally via your browser, unless you set up a local webserver (instructions [here](setup-local-server)). -``` -The code shown above gives: - - -More information on Grasple and the support of TU Delft can be found on: [Teaching Support - Educational Tools - Grasple](https://www.tudelft.nl/en/teaching-support/educational-tools/grasple) - -## Replace iframe by QR code for printed version -Dani Balague Guardia created an [extension](https://github.com/dbalague/sphinx-grasple) which allows you to easily add Grasple question with some formatting and, more importantly, the creation of QR codes in the PDF version of the page. This leads to the source link of the iframe. - -This extension can be installed by running - -`pip install git+https://github.com/dbalague/sphinx-grasple` - -The grasple exercise as shown above can now be added as follows in your markdown file: -```markdown -::::{grasple} -:url: https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907 -:label: grasple_exercise_1 -:dropdown: -:description: Example of exercise which goes along - -:::: -``` - -This leads to the following html in the Jupyter book. Remark: again, the iframe doesn't locally in VScode or in the build file, only on the hosted version. -
- -

Grasple Exercise 1

-
-
-
-

Example of exercise which goes along

-

-
-
-
-
- -In the PDF this leads to: -```{figure} ../images/Grasple_pdf.png -``` - - -The extension requires an extension of the `config.yml` file: -```markdown - extra_extensions: - - sphinx_grasple - - sphinx.ext.imgconverter -``` - -The extension should be installed both locally and on the server. \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index ada3d80..7251625 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ sphinx-inline-tabs jupyterlite-sphinx jupyterbook_patches download_link_replacer +teachbooks-sphinx-grasple --extra-index-url https://gitlab.tudelft.nl/api/v4/projects/11239/packages/pypi/simple