How do I write questions in GIFT format?

In Moodle we could build the questions individually and sort them into the question bank one at a time, but there’s a much faster way to get your question banks onto Moodle. This faster way is GIFT formatting, a particular way of writing our questions in a word processor (Microsoft Word or OpenOffice for example) that will let us upload multiple questions and answers at once. It might seem a bit weird at first, but it can be a real time saver.

The first thing we’ll do is open a word processor like Microsoft Word or Open Office. Unfortunately Google Docs doesn’t let us save the file the way we need to, but if you prefer it, you can write your questions there and copy them into Word or Open Office when you’re ready to save. When you open your new document, don’t write a title, instructions, or even a question number. Instead just write out the questions and answers.

Let’s start with the easiest to write: Essay and Short Answer. When we write a question, we only write the question text, no question numbers or category names. After we write the question text, we’re going to make a new line and write a { followed by a }. So as an example:

Briefly explain the process of uploading questions and answers from a word document to Moodle.

Make sure there aren’t any extra spaces after the . in the question.

The next easiest type of question is the true or false. Again you write the question text without a question number or category name, on a new line write a { followed by a T or F depending which is the correct answer for the question, then write a } to close the answer.

So a question with a true answer will look like this:

True or False, when uploading your questions to Moodle, you should first set up your categories before importing your questions.

And a question with a false answer will look like this:

True or False, it is alright to upload questions with extra spaces after the period.

The last type of question we’ll make is multiple choice. We can write multiple choices in a way that tells Moodle which answer is the correct answer and which answers are wrong. To write a multiple choice question, we write the question text without any numbers. Then on a new line we write a {. Now we’re to tell Moodle if the next answer is correct or incorrect. If the answer is correct, we’ll write a =, if it’s wrong, we’ll write a ~. Then we’ll write the answer text with no space between the answer and the ~ or =. On a new line we’ll again identify whether the next answer is correct or incorrect with the ~ or =. Once we’ve listed all of our answers, we’ll write a } right after our last answer.

This is what a multiple choice question written that way looks like:

When you’re writing a multiple choice question for Moodle in GIFT format, the = symbol identifies that the following answer is:
{~a partially correct answer
=the correct answer
~a hint
~an incorrect answer}

And here’s another example

When you’re writing a multiple choice question for Moodle in GIFT format, the ~ symbol identifies that the following answer is:
{~the correct answer
~a partially correct answer
~a hint
=an incorrect answer}

If you want a video example, check out this tutorial.

Now that we know how to write the common question types, it’s time to begin writing our questions in our document. Write your questions so that you can upload the questions to a single category. As an example I’m going to write my two multiple choice questions in a single document so that I can upload them to a single category.

Slide 4

As you can see in the document, there isn’t any title or instructions in the document, the questions do not have numbers, and the multiple choice questions aren’t lettered.

Now that all of the questions that I want to upload in this category are in this document, it’s time to save it. When I save this document I am NOT going to save it as a .doc, instead I need to save it as a Plain Text file. So I’ll use the Save As… feature and change the format to Plain Text.

Slide 5

Because we’re saving the file as a plain text file, the word processor wants to know what encoding we want to use. Moodle needs us to save the document using UTF-8. So when I save my document I have to select other encoding then select UTF-8 from the list. The steps might be slightly different for you, but you still have to save the document using UTF-8 encoding.

Slide 6

If you have questions about writing or importing your questions, please contact us at

Show your support

Clapping shows how much you appreciated Jason Hogan’s story.