-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for base64 images #55
Comments
Everything related to Pandoc is for exporting solutions in PDF or HTML or other formats, so initially you can ignore that when adding new features. Once you have implemented a new feature, you need to make sure that it works with Pandoc export as one of the final steps. In this case, I don't expect that any Pandoc changes will be needed. You will want to focus on I would suggest a new command-line option like |
Hello, Best regards |
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 incmdline.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:
export.py
What's needed for adding new question types? #52 (comment)data:
URIs using the --self-contained command-line optiontext2qti/text2qti/markdown.py
Line 57 in de0c805
I would probably add a
--pandoc-self-contained
boolean command-line option which would make is so that :src
attributes are replaced bydata:
URIs ;What do you think ?
The text was updated successfully, but these errors were encountered: