Updated on July 25th, 2019

WIRIS

Are you looking for an easy method to create large number of questions in your Moodle course?

Creating large number of questions for your Moodle quiz can be a time-consuming task. If you are planning to create your questions right in Moodle question bank, which is a commendable practice that will save you time in the long rung, you need to create questions one by one.

Luckily, Moodle supports different formats that can be used to import questions into Question bank categories and as lesson question pages. These includes some proprietary, text-based scripting and Moodle-specific formats. Some of them are:

GIFT is the most comprehensive import format available for importing Moodle quiz questions from a text file. In this article, we will take a brief look on to the GIFT format.

The GIFT Format

The Moodle GIFT format allows to create different types of questions using a text editor. You can create multiple-choice, true-false, short answer, matching missing word and numerical questions easily.  Once done, just save the text file and upload it to Moodle either into a question category or into a lesson.

Moodle also supports exporting questions to GIFT format which may be useful to proofread questions in a single category.

Initially, it may take some time to understand writing the questions syntax in GIFT format. But once you can master it, then you can create large number of questions in no time.

You can create Multiple Choice, Multiple choice with multiple right answers, True-False, Short Answer, Matching, Missing Word, Numerical Question, Essay type questions. In addition to these question types, the GIFT format also allows you to add line comments, question name, feedback and percentage answer weight within the text file.

Back to Top

GIFT syntax basics

The basic rules for GIFT format are:

  • Any GIFT file must be correctly encoded in UTF-8. You can any text editor. NotePad++, Sublime, Atom or even Vim if you’re an adventurer!
  • At least one blank line must be left between each question.
  • In the simple form, the question comes first, then the answers are set in between brackets, with an equal sign (=) indicating the correct answer(s) and tilde (~) the wrong answers.
  • Questions can be weighted by placing percentage signs (%..%) around the weight.
Back to Top

Some samples

Courtesy and credit: Paul Shew, at Aoyama Gakuin University.

Cloze (fill in the blanks)

Who's buried in Grant's tomb?{~Grant ~Jefferson =no one}

Grant is {~buried =entombed ~living} in Grant's tomb.

Grant is buried in Grant's tomb.{FALSE}

Who's buried in Grant's tomb?{=no one =nobody}

When was Ulysses S. Grant born?{#1822:1}

Multiple choice

Who's buried in Grant's tomb?{~Grant ~Jefferson =no one}

Grant is {~buried =entombed ~living} in Grant's tomb.

The American holiday of Thanksgiving is celebrated on the {
    ~second
    ~third
    =fourth
} Thursday of November.

Japanese characters originally came from what country? {
    ~India
    =China
    ~Korea
    ~Egypt}

Short answer

Who's buried in Grant's tomb?{=no one =nobody}

Two plus two equals {=four =4}.

True or false

Grant is buried in Grant's tomb.{F}

The sun rises in the east.{T}

Matching

Matching Question. {
    =subquestion1 -> subanswer1
    =subquestion2 -> subanswer2
    =subquestion3 -> subanswer3
    }
    
Match the following countries with their corresponding capitals. {
    =Canada -> Ottawa
    =Italy  -> Rome
    =Japan  -> Tokyo
    =India  -> New Delhi
    }

Numerical

When was Ulysses S. Grant born? {#1822}

What is the value of pi (to 3 decimal places)? {#3.1415:0.0005}.

What is the value of pi (to 3 decimal places)? {#3.141..3.142}.

When was Ulysses S. Grant born? {#
    =1822:0
    =%50%1822:2}
Back to Top

Options and GIFT customization

You can add comments, names, headings and feedback to right and wrong answers. For more advanced markings, you can add weights and make combinations.

Inline comments

// Subheading: Numerical questions below
What's 2 plus 2? {#4}

Question name

::Kanji Origins::Japanese characters originally
came from what country? {=China}

::Thanksgiving Date::The American holiday of Thanksgiving is 
celebrated on the {~second ~third =fourth} Thursday of November.

Feedback

What's the answer to this multiple-choice question?{
~wrong answer#feedback comment on the wrong answer
~another wrong answer#feedback comment on this wrong answer
=right answer#Very good!}
    
Who's buried in Grant's tomb?{
=no one#excellent answer!
=nobody#excellent answer!}

Grant is buried in Grant's tomb.{FALSE#No one is buried in Grant's tomb.}

Percentage answer weights

Difficult question.{~wrong answer ~%50%half credit answer =full credit answer}
         
::Jesus' hometown::Jesus Christ was from {
    ~Jerusalem#This was an important city, but the wrong answer.
    ~%25%Bethlehem#He was born here, but not raised here.
    ~%50%Galilee#You need to be more specific.
    =Nazareth#Yes! That's right!}.
    
::Jesus' hometown:: Jesus Christ was from {
    =Nazareth#Yes! That's right!
    =%75%Nazereth#Right, but misspelled.
    =%25%Bethlehem#He was born here, but not raised here.}

Multiple answers, varying marks

What two people are entombed in Grant's tomb? {
	~No one
	~%50%Grant
	~%50%Grant's wife
	~Grant's father }

What two people are entombed in Grant's tomb? {
	~%-50%No one
	~%50%Grant
	~%50%Grant's wife
	~%-50%Grant's father }

Advanced examples using multiple features

::Grant's Tomb::Grant is {
      ~buried#No one is buried there.
      =entombed#Right answer!
      ~living#We hope not!
} in Grant's tomb.

Difficult multiple choice question.{
     ~wrong answer           #comment on wrong answer
     ~%50%half credit answer #comment on answer
     =full credit answer     #well done!}

::Jesus' hometown (Short answer ex.):: Jesus Christ was from {
     =Nazareth#Yes! That's right!
     =%75%Nazereth#Right, but misspelled.
     =%25%Bethlehem#He was born here, but not raised here.
}.

//this comment will be ignored by the filter
::Numerical example::
When was Ulysses S. Grant born? {#
     =1822:0      #Correct! 100% credit
     =%50%1822:2  #He was born in 1822.
                  You get 50% credit for being close.
}
Back to Top

Using GIFT with added Media

But wait a minute, You can’t use GIFT format for questions with images or other media files.

Luckily, Jean-Michel Védrine has developed a useful plugin: Gift with medias format. This plugin works exactly like the default GIFT format but instead of text file it imports a ZIP file containing the gift text file and media files.

Moodle - GIFT with Medias format plugin
Moodle – GIFT with Medias format plugin

Ripples (References and Resoures)


Moonami LogoOur coverage on The Tech and the latest innovations behind LMS and Learning Systems is supported by Moonami, a company that provides a full range of Moodle services combining the flexibility, scalability, and power of Amazon’s world-leading cloud platform (AWS) with fanatical Moodle support. Click here to learn more.