-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Hello,
Thanks very much for your neat piece of software, which is really helpful to build quizzes ! I work in a team delivering online courses to 2700+ students every year. We plan on using the quizzes produced by text2qti inside D2L's BrightSpace LMS, which supports the QTI 1.2 specification.
The issue
We determined that BrightSpace has issues using file URLs on import, as it fiddles with the imported content URLs. For instance, it adds a web_resource part to the image path at render time for an unknown reason, which breaks the link to the image.
We would like our quizzes to be as portable as possible, so that they can be imported anywhere without a messy handling of (possibly duplicated) files, permissions, 404s, etc. Our expected use case is to drop a self-contained ZIP file containing a bunch of XML files and no external file.
The proposal
One solution is to use base64 images instead of file URLs, as this removes the need to store external files and maintain functional links to those : everything is included in the XML file. We asserted that BrightSpace can handle base64 images properly.
How to do it
In this comment #42 (comment) @gpoore says that "it would probably be easy to add an option that converts all images into inline base64 encoded img". That's great news, and I'm willing to tackle this issue !
I tried naively to pass --self-contained to the Pandoc commands in cmdline.py, but it didn't work. 🤷♂️
I'm a competent though rusty Python developper, and I would be very thankful for any guidance to get me started.
Here is the information I gathered so far:
- Questions in text2qti are_ processed through Pandoc in
export.pyWhat's needed for adding new question types? #52 (comment) - Pandoc can export
data:URIs using the --self-contained command-line option - My guess is that the image conversion happens around here ?
Line 57 in de0c805
class Image(object):
I would probably add a --pandoc-self-contained boolean command-line option which would make is so that :
- images'
srcattributes are replaced bydata:URIs ; - files are not copied in the ZIP file.
What do you think ?