Grasple questions#
User types
This section is useful for user type 3-5.
Grasple gives you an embed code for each exercise which looks like this, which can be added cirectly to your markdown-file.
<iframe height="560" src="https://embed.grasple.com/exercises/767782d5-023a-4b49-a1f3-874fca626c8e?id=79907" title="Grasple Exercise 79907" width="100%" allow="clipboard-read; clipboard-write"></iframe>
The embed link is created for an exercise under ‘More’- ‘Embed Exercise’
This iframe can be embedded into your Jupyter book.
Note
This feature doesn’t display in a book that is viewed locally via your browser, unless you set up a local webserver (instructions here).
The code shown above gives:
More information on Grasple and the support of TU Delft can be found on: Teaching Support - Educational Tools - Grasple
Replace iframe by QR code for printed version#
Dani Balague Guardia created an extension 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:
::::{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
Show/Hide Content
In the PDF this leads to:

The extension requires an extension of the config.yml
file:
extra_extensions:
- sphinx_grasple
- sphinx.ext.imgconverter
The extension should be installed both locally and on the server.