Question format-GIFT

In Moodle, questions can be used in quizzes and lessons to assess students' knowledge. These questions can be created in the Moodle question bank with multiple clicks and inputs through a web form. Moodle provides various question types for this purpose, such as cloze questions, simple calculations, or multiple-choice selections (among many others). As an alternative to creating questions in a web form, questions can also be created in a text file and imported. This might make question creation easier, depending on your preferences. There are various formats available for managing questions in text files, which we will introduce in a brief series. One of these formats is the GIFT (General Import Format Template) file format.

With the GIFT format, various Moodle question types can be created. These question types include multiple-choice questions, true/false questions, short answer questions, matching questions, cloze questions, and numerical questions. The following section will provide you with a detailed introduction to the GIFT format.

Example

The following example shows a single-choice question in the GIFT format within a text editor:

// Question: 1 Name: Grant's Tomb
::Grant's Tomb::Who is buried in Grant's Tomb in New York City? {
=Grant
~Nobody
#That was true for 12 years.
~Napoleon
#He was buried in France.
~Churchill
#He was buried in England.
~Mother Teresa
#She was buried in India.
}
This is what the imported question would look like in Moodle.
Symbol Usage
// Comment
= Correct Answer
~ Incorrect Answer
::Title:: Title
# Feedback
-> Matching in Matching Questions
{ Start of Answer Choices
{# Start of a Numerical Answer
: Number Range in a Numerical Question
%50% 50% Weighting; half points awarded for this answer

General Structure of a Single-Choice Question

//Comment line
::Question Title::
Question text{
=Correct Answer
~Incorrect Answer 1
#Feedback for incorrect answer 1
~Incorrect Answer 2
#Feedback for incorrect answer 2
~Incorrect Answer 3
#Feedback for incorrect answer 3
~Incorrect Answer 4
#Feedback for incorrect answer 4
}

For more information about the format and the syntax of other question types, please refer to the Moodle Docs (opens in new tab).

Creating GIFT Questions

Any text editor, such as the default text editor in Windows, is suitable for creating GIFT questions. Afterward, save your questions in UTF-8 format to avoid display errors.

Importing GIFT Questions

You can add the GIFT questions you’ve created to your question bank in Moodle and then use them in quizzes and lessons. To access your question bank, go to the “More” tab in the top navigation bar and then click on “Question Bank”. In the overview of your “Question Bank”, you have the option to select “Import” from the top dropdown menu. Within the import section, you can now choose the GIFT format.

By selecting the GIFT format and adding the respective file, you can add your GIFT questions to the question bank at this point.

Importing the text file
Importing the text file

This content is based on the Moodle Docs (opens in new tab). Certain elements have been adopted from them.