Note: We recommend installing the GIFT Format Pack which bundles both this extension and a live previewer for the GIFT Format.
This extension provides language support for Moodle's GIFT format. Using this extension, you can write questions in GIFT with modern text editor features including syntax highlighting, error checking and useful snippets that improve the overall development experience.
Features:
- 🌈 Syntax Highlighting
- ❌ Error Checking
- ✂️ Snippets for all supported question types
- 🚀 Quick Actions for repetitive tasks
- 👀 Live Preview (with GIFT Format Preview)
- 📘 LaTeX Support
Docs: GIFT Format Docs
See Also: GIFT Format Pack, GIFT Format Preview
Background:
Plugin:
Reference:
The GIFT format is an alternative way of authoring Moodle quizzes that makes writing large banks of questions easy.
Using just a text editor, you can prototype, edit and test Moodle quizzes without needing to log onto Moodle. Once your question bank is ready to be used, you can import questions written in GIFT into your Moodle course.
GIFT supports many common question types including:
- Multiple Choice
- Multiple Choice with Multiple Answers
- Matching
- Short Answer
- Missing Word/Cloze
- True-False
- Essay
- Numerical
Best of all, writing in GIFT is simple and fun, and makes creating large question banks in Moodle a breeze.
Currently, the best way to learn the GIFT format is to look through the Moodle docs.
For a quick reference of the GIFT format, you can also use the VSCode GIFT Format Docs which also provides documentation on advanced GIFT features including LaTeX, including media and videos.
To install the plugin, we'll first need to install Visual Studio Code. Visual Studio Code is an open-source text editor for Windows, macOS and Linux, with powerful features for working with programming languages.
To install Visual Studio Code:
- Download the installation file from the Visual Studio Code website.
- Install the program.
If you're having trouble with installation, you can consult the Visual Studio Code documentation.
Once Visual Studio Code is installed, you can add the extension through the Extension Marketplace.
For the majority of users, we recommend installing this extension through the GIFT Language Pack, which adds support for live question previews.
To install the GIFT Language Pack:
- Open Visual Studio Code.
- Follow this link to the GIFT Language Pack and click the
Install
button. - When prompted, allow your browser to open Visual Studio Code.
- The extension should now be installing in your editor.
Once installation is complete, we're now ready to write Moodle quizzes in the GIFT format.
To start writing in the GIFT format:
- Create a new file in Visual Studio Code by going to
File > New File
, or open an existing GIFT file. - Go to the bottom right corner of your window and click on
Plain Text
. Alternatively, pressCTRL K
followed byM
on your keyboard. - A list of languages will appear in your window. Find
Gift
and select it as the file's language. - Once the language is activated, you'll be able to write in the GIFT format with syntax highlighting, error checking and snippets enabled.
If you need help in understanding the GIFT format, refer to the Learn GIFT section for more information.
This extension provides code snippets, which allow you to quickly scaffold questions in the GIFT format.
To activate the snippet dropdown, start typing the name of a question type into the editor (e.g. multiple choice question
, short answer question
). A full list can be found in the Snippet Reference section.
Select a snippet by pressing the UP and DOWN arrow keys on your keyboard. Once you've found the right snippet, press ENTER to insert it into your editor.
To navigate through the snippet, use the TAB
and SHIFT TAB keys. When you've found a part of the snippet you want to edit, start typing!
This extension provides two types of snippets:
- Plain-English Snippets (e.g
short answer question
) - Shorthand Snippets (e.g.
saq
,sa2
)
Each question type has both a plain-English and a shorthand equivalent (e.g. multiple choice question
, mcq
). For some question types, there are also numbered snippets (e.g. mc2
, sa4
) which correspond to the number of answers in the template.
Plain-English | Shorthand |
---|---|
multiple choice question |
mcq , mc2 , mc3 , mc4 , mc5 , mc6 |
multiple choice question multiple |
mcqm , mc2m , mc3m , mc4m , mc5m , mc6m |
matching question |
maq , ma2 , ma3 , ma4 , ma5 , ma6 |
short answer question |
saq , sa1 , sa2 , sa3 , sa4 , sa5 , sa6 |
missing word question |
mwq , mw1 , mw2 , mw3 , mw4 , mw5 , mw6 |
true false question |
tfq |
essay question |
ess |
numerical question |
nq |
title |
|
category |
cat |
category nested |
catn |
description |
des |
All question types also include snippets with titles. For plain-English snippets, add title
to the end of your existing snippet. For shorthand snippets, add a t
.
Plain-English | Shorthand |
---|---|
multiple choice question title |
mcqt , mc2t , mc3t , mc4t , mc5t , mc6t |
multiple choice question multiple title |
mcqmt , mc2mt , mc3mt , mc4mt , mc5mt , mc6mt |
matching question title |
maqt , ma2t , ma3t , ma4t , ma5t , ma6 |
short answer question title |
saqt , sa1t , sa2t , sa3t , sa4t , sa5t , sa6 |
missing word question title |
mwqt , mw1t , mw2t , mw3t , mw4t , mw5t , ma6 |
true false question title |
tfqt |
essay question title |
esst |
numerical question title |
nqt |
Question {
=Correct Answer
~Incorrect Answer 1
~Incorrect Answer 2
~Incorrect Answer 3
}
Question {
~P%Correct Option 1
~P%Correct Option 2
~%-100%Incorrect Option 1
~%-100%Incorrect Option 2
}
Question {
=Item 1 -> Match 1
=Item 2 -> Match 2
=Item 3 -> Match 3
=Item 4 -> Match 4
}
Question { =Answer }
Sentence Start { =Correct Answer ~Incorrect Answer 1 ~Incorrect Answer 2} Sentence End
Question {TRUE}
Question {}
Question {#Number:Range}
::Title::
$CATEGORY: Name
$CATEGORY: Level 1/Level 2/Level 3
Description
Special thanks to Chris Fuhrman for his work in creating a parser for the GIFT format and for his invaluable support in the project.
MIT