SUBSCRIBE

Do You Want To Easily Create A Large Number Of Questions In Your Moodle Course?

gift moodle quiz scripting
AI in Education Leaderboard Post Page
Ai In Education Square Post Page

--- Advertisement ---

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)

2 Responses

  1. I have created a new plugin to generate questions for moodle, without having to enter the platform. The plugin FastTest PlugIn generates the XML file and all you have to do is import the file, after creating the questions with the plugin.

    With this plugin, you don’t need to know these XML codes!

    I offer it free to use. I send a link to a document where the video tutorials and an index with the content are shown. Although the content is in Spanish, the plugin is in Spanish, English and French. It is also in Italian, German and Portuguese, but I have translated these three languages with the Google translator.
    https://drive.google.com/file/d/1oOJyMqlyG9VrR9WMd_pJ1MmwM1xDnOQR/view

    It is not necessary to install it in Moodle, you can work in Excel desktop (Excel online does not work). In addition to the fact that the questions can be generated quickly, many of the same questions can also be asked, but changing some variable data, in one go.
    I put the link with the index on the questions that are currently configured and where you can also download the latest version of the application.
    I could use it very well if you make your comments. The application is free to use, but it is registered so that no one can profit from it.
    https://drive.google.com/file/d/1oOJyMqlyG9VrR9WMd_pJ1MmwM1xDnOQR/view

    The first thing I recommend, that no one download a file without knowing its origin. I have the application hosted on Git, so that no one uses a version that has been passed to them without checking its origin. Especially files like this, which is an Excel with macros.

    The YouTube channel where the application tutorials are shown is:
    https://www.youtube.com/channel/UCTkOmf2IiTvxn1ch9hYjYQQ

    The link to download it is:
    https://github.com/MilagrosHuerta/FastTest-PlugIn

    I am trying to contact the Moodle developers, so that they know it and so there are more people who can benefit from this plugin. I have developed it within an innovation project at the University of Cádiz (Spain).

    Sorry, but my english is not so good!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

The Latest

The eLearn Podcast

--- Advertisement ---

Subscribe to our newsletter

Education technology has the power to change lives. 

To get the latest news, information and resources about online learning from around the world by clicking on the button below.