4620635228_f658015400

One of Moodle’s greatest strengths is that you can create banks of questions that you can use in a variety of ways. (I’ll be examining some of those ways in future tutorials.) The flip side is that creating these questions can be a tedious and often frustrating experience.

Fortunately, there is an easier way. With a text editor such as Notepad (which comes bundled with Windows), it is possible to create large numbers of questions in a fairly short amount of time. Using this method, you can create the following types of questions:

  • multiple choice with a single correct answer
  • multiple choice with multiple correct answers
  • true-false
  • short answer
  • matching
  • missing word (cloze)
  • essay
  • numerical (i.e., math) questions

Update Information:

I have moved all my Moodle courses to a new, more robust version of Moodle, which you can view here, so all the links are working. I highly recommend that you create a user account there, so that you have full access to all the free courses I offer.

I’ll show you how to create all of those (with the exception of the math questions, which I’ll cover later) in this tutorial. This tutorial assumes that you already have some experience creating questions in Moodle. If not, you can get up to speed by reading this.

Because it’s usually easier to understand these concepts if you see them in action, I have created a Moodle course that demonstrates these question types. Each topic shows a variation on these question types, and includes the actual code used to generate the question. You can access the course here. Log in as a student and use the enrolment key “Cornwall” or login as a guest and use the password “MOO120”. (Unforunately, Moodle does not allow guests to see questions. I recommend that you create a user account to fully see the quiz questions. Once you do that, you’ll also have full access to all the other free courses I offer on Moodle.)

You can also download the original GIFT question file I uploaded to the course here.

Prerequisites

To create Moodle questions in GIFT format, you need a text editor that is capable of saving documents with a UTF-8 encoding. Notepad will save documents in UTF-8 simply by selecting “UTF-8” in the “Encoding” pop-up menu when you save the document:

notepad-utf-8

If you work with languages that have diacritical marks (accents, umlauts, and the like), I recommend you download Notepad++, which does a better job of handling those characters. I use Notepad++ because it shows line numbers, which make it easier to find things in large documents. Unless otherwise stated, screen captures here are taken in Notepad++.

Getting Started

There are three basic parts to a Moodle question: the question title, the question text, and the question answers.

About Question Names

It helps to give your questions good names that will help you to remember what question they are. I usually use one to three keywords that describe the question, an abbreviation to tell me what kind of question it is (short answer, matching, etc.) and a number, since I may have several questions that are similar and I want to distinguish among them.

If you don’t specify a question name, the entire question will be used as a title. While this can be useful in some cases, it can make it difficult to navigate Moodle. I recommend creating your own question names.

It also helps to use descriptive categories and subcategories. You can do this with GIFT quite easily, but I’ll talk about that in a future tutorial.

Comments

GIFT allows you to create anywhere from a single question to thousands in the same file. Because of this, you may want to add comments to your text file. Comments can serve many purposes, including:

  • Organizing your questions
  • Reminding yourself of things to check on (spelling, for instance) before you import your questions into Moodle
  • Information for other users of the file

Adding comments is easy. Just type two forward slashes (//) and then type your comment. Everything from the forward slashes to the end of the line (that is, until you press the return key) will be considered a comment and will not be imported into Moodle.

This is what a comment looks like:

Comments have three important characteristics you need to remember:

  1. It’s always better to add a comment you don’t need later than to omit one you later need. If in doubt, add a comment.
  2. Users will not be able to see your comments once you import your questions into Moodle. This is a good thing.
  3. You will not be able to see your comments once you import your questions into Moodle. While you can always edit your questions once you have them in Moodle, if you leave yourself a note via a comment, that note will not be available once your questions are imported. If you use comments as a reminder of things to do, be sure to do them all before you import your questions.

Basic GIFT Question Format

These are the basic conventions to use when creating questions in GIFT:

  • Questions are always separated from one another by one or more blank lines.
  • Question names are surrounded by pairs of colons:

  • Answers are enclosed in curly brackets: {}
  • Question texts go between the titles and the answers.
  • Feedback is always preceded by a hash mark (#).

Question Types

True-False Questions

True-false questions are of questionable pedagogical value, but since they are one of the easiest question types to create in GIFT, let’s start with them:

Begin by typing the question name, enclosed in pairs of colons:

Next, type the question text:

George Washington is considered the father of our country.

All we need to do now is to provide the answer. Remember that answers in GIFT are always enclosed in curly brackets: {}. Since this answer is right, we type:

We can also just type {T}. If the question is false, we just set the answer to {FALSE} or {F}:

You can also add feedback to your answer. In the case of true-false questions, Moodle will only display feedback if your student selects the wrong answer. Keeping that in mind, our feedback for the above questions might look like this:

Remember that students will see the feedback for the first question only if they select “False” and they will see the feedback for the second question only if they select “True”.

Matching Questions

Matching questions consist of pairs of words or phrases that students must match up. GIFT considers the matching pairs to be the answer, so they are enclosed between curly brackets.

The stem of the matching is pair is preceded by an equal sign (=) and the option is preceded by a hypen and a greater-than sign (->).

Considerations

Matching questions do not support feedback, so if you are testing for something for which feedback is an important consideration, you should use another question type.

Additionally, matching questions do not support weighted answers, so if you have partially correct answers as possibilities, you may want to choose a different question type. For example, if you ask “What is the capital of the United States?” and you want to give full credit for “Washington D.C.”, and partial credit for either “Washington” or “D.C.”, you should use a different question type.

Best Practices

Ideally, you should include more options than stems. You can do that by including options that don’t have a stem:

The options appear in a drop-down menu, so the ideal number of matching pairs is twelve or less. Anything more than 12 can make it difficult for students to select an appropriate answer.

Because options appear in a drop-down menu, make the longer item (such as a definition) the stem and the shorter item (such as the term) the option.

Think outside the box. Matching questions do not need to simply match terms with their definitions or countries with their capitals. You can match the first half of a word or sentence with the second half. If you are teaching another language, you can can match articles with nouns or subjects with verb conjugations.

For more about constructing matching questions, read this page from the University of Texas.

Short Answer Questions

Short answer questions require students to type in an answer. These questions allow for more than one correct answer, and also allow for feedback.

If you want to provide for the possibility of multiple correct answers, precede each one with an equal sign:

Multiple Choice Questions

Multiple choice questions have one correct answer and one or more wrong answers. To create a multiple choice question, prefix the correct answer with an equal sign (=) and the wrong answers with a tilde (~):

You can also add feedback which will show if the student selects that answer:

Multiple Choice Questions with Multiple Correct Answers

Regular multiple choice questions display their answers as radio buttons: if a students selects an answer, and then selects another answer, their first choice is automatically deselected. Multiple choice questions with multiple correct answers display their answers as checkboxes, allowing students to make multiple choices.

To create a multiple choice question with multiple correct answer, precede each answer with a tilde (~) and then apply a weight (on a scale of 0-100) between percent signs:

Notice that I have included negative answer weights for the wrong answers, because otherwise students could get full credit simply by checking all the boxes.

Because of this, it’s best to include feedback with this type of question.

Missing Word Questions

The missing word format automatically inserts a fill-in-the-blank line (_______) in the sentence where you indicate an answer.

If you specify a single correct answer, the question will require students to type in their answer:

If you specify a single correct answer and one or more wrong answers, the question appears as a multiple choice question:

For missing word questions to work properly, the answer must come before the closing punctuation of the question. Otherwise, questions with a single answer appear as an ordinary short answer question, and questions with multiple answers appear as an ordinary multiple choice question, except that students may not understand the question thoroughly.

Importing Your Questions into Moodle

Once you have your questions created and your document saved (be sure to save it with a “.text” extension), you’re ready to add them to Moodle.

  1. Navigate to your course.
  2. In the Administration block, quick on “Questions”:
    admin-block-questions

  3. In the question bank, click on “Import”:
    question-bank-import

  4. Under “File Format” select “GIFT format”:
    GIFT-format

  5. Under “Import from file upload…” click “Browse” to find your file and then click “Upload this file”:
    import-from-file-upload

  6. Moodle will then tell you that it is “Parsing questions from import file” and will then tell you how many questions it imported and what they looked like. Click on the “Continue” button and you’re ready to start using your questions in quizzes.

Troubleshooting

My first comment is showing up as a separate question.

Be sure to save your file with UTF-8 encoding. (If you are using Notepad++, save it as “UTF-8 without BOM”.)

Accent marks are not showing up.

Again, make sure that you save your file as a UTF-8 encoded file before you add any accent marks.

My question was imported (and mangled) as two different questions.

GIFT uses blank lines to separate questions, so make sure that your question is either on a single line, or on consecutive lines with no blank lines in between.