Updated on January, 2020. Once again, Charles Severance AKA “Dr. Chuck” comes to the rescue. Check out the video above to see how to use the GIFT format and export questions to any LMS that supports the IMS QTI 1.2 or the IMS Common Cartridge specifications. Now you can enjoy the powerful tools “Moodlers” have enjoyed for years, from the comfort of your LMS.
Use Chuck’s GIFT converter here. The source code is free, get it from GitHub here.
Give Yourself A Productivity GIFT: Super Easy Language To Develop Moodle Questions
Original post:
The GIFT format is a flexible and friendly format for creating quiz questions and importing them into Moodle. Among the different import options, I find that the GIFT format is the easiest to learn and best available if you are not using a proprietary quiz question test bank generator. All you need is a plain text editor or IDE and some attention to detail.
Did you also know that you can support images in your questions with the GIFT format? By knowing just a little HTML you can easily host your images on a public 3rd party site and insert them into any GIFT formatted items before you upload (this will save you server space and loads of time if you need to update the question image in the future – since there’s only one copy).
Here’s a sample question where an image, which is uploaded to AWS S3, is inserted into the question in GIFT format:
What does this icon in Moodle represent? <p><img src\="https://lmspulse.com/wp-content/uploads/image11.jpg" /></p>? { ~Edit =Help ~Hide ~Enter }
Pretty simple. Paragraph tags will put it on it’s own line while their absence will put the image inline with the question text. Here’s what the formatted question looks like after import:
References & Resources
- GIFT format at docs.moodle.org
- IMS Question & Test Interoperability (QTI) Specification at IMS Global
- IMS Common Cartridge® Specification
See also:
3 Responses
Nice one Joseph! I never knew this. Thank you for highlighting this useful feature of the GIFT format.
There is also Jean-Michel’s plugin https://moodle.org/plugins/view.php?plugin=qformat_giftmedia where you upload a zip file containing the gift format questions and any files they require.
Also, not that if you want to get technical, you can adjust how Moodle processes the GIFT text. If you turn off the Moodle HTML editor, then for each bit of input you can specify the type, HTML, Markdown or Moodle auto-format. You can tell GIFT to treat the content of your GIFT files as any one of those three. To see how, make some questions in Moodle, and then export them, or look at the examples in the Unit tests. Here is an extreme example: https://github.com/moodle/moodle/blob/40f0ad21a3fbfaf6e04cc1d53778cf2ca710b8bd/question/format/gift/tests/giftformat_test.php#L110
Tim, thanks for sharing those. It’s cool how you can control the input type through GIFT as well. That’s why I like it, the syntax is friendly at the simplest but very very powerful when you get into more complex commands within the GIFT file for each item.