-
Notifications
You must be signed in to change notification settings - Fork 67
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
Download remote files and include in QTI folder? #45
Comments
Can you say a little more about how a feature like this would be used? For example, are you thinking about a command-line option that specifies a location for downloading images, or somewhere in the text file that specifies this? Are there advantages to having this built into text2qti, versus having a script that downloads the images if they don't exist, and then always running the script before text2qti? |
Sure. The way I was thinking it would work would be via command line options:
Reasoning: We are developing an internal website that generates QTI files - it firsts makes a markdown representation - then runs it through text2qti* - but we are also giving the instructor the ability to download the markdown. Markdown doesn't store images so either we bundle those images in a zip, or link to our website. However, those URLs might not be reachable by canvas, so I would prefer to upload them via QTI rather than link to an external resource. As part of the site, we'll also be allowing trusted users to upload a markdown document and have it run it through text2qti. For instance, they might want to edit the quiz before importing the QTI into canvas. Not all are familiar enough with python or can install the windows GUI tool. So my thought was, when generating the markdown on our website, use URLs instead of file paths, and when we run the tool have text2qti download the resources. That being said - I could easily pre-process the uploaded markdown to download the resources locally. I could imagine a scenario where for authentication reasons having your tool do the download could get tricky/impossible... so perhaps it doesn't fit directly in the package. *Long-term plans are to work with canvas APIs, but since other quizzing platforms support QTI this is a great first option for cross-platform quiz question generation. The general idea is to generate hundreds of questions to help create random quizzes in canvas. |
I've thought about this a little more, and have an alternative suggestion. How about new command-line options like Of course, there might be some complexity about keeping the cached images updated and possibly also some questions about what to name the files, but I expect that implementing basic functionality would be relatively straightforward. text2qti is already using a custom |
That sounds excellent - I think it would be up to the user to either empty out the image directory or the default would be to skip already downloaded. Obviously this needs a lot of thought: What about identically named files at different URL paths (ie, https://example.com/session1/image.jpg, https://example.com/session2/image.jpg) - make files named after a hash of the contents? What if someone links to a file without an extension? Just some initial thoughts. |
For identical files: I'd suggest creating subdirectories within the cache that are based on hashes of the complete URL path without the file name, and then putting files within those while preserving the original name. So For links without extensions: Maybe just restrict to common image extensions, at least at first. |
We are using this tool to generate quizzes for Canvas, and one of our workflows would benefit from being able to have the script download image assets locally (via parameter), rather than link to the respective website. I have a general idea where to make this change in the codebase, and could make a pull request if there's interest in it, and if this is something that would get merged.
The text was updated successfully, but these errors were encountered: