Title: Why the Gapfill question type was developed
Course: Gapfill Question Type Examples > Section: Moodle Gapfill Question Type Demonstration Course.

Why was it developed

The Moodle Gapfill question type: Marcus Green

The gapfill question type is designed to be very easy for teachers to create new questions in Moodle. All you need to learn is the contents of one 7 word sentence as follows.

"Put square braces around the missing words"

Each word surrounded by special characters (which defaults to square braces) becomes a gap for the student to enter an answer. So the archetypal question text reads,

The [cat] sat on the [mat]

and the student sees the sentence with gaps for cat and mat and have to enter those words in the spaces in order to get the marks for the question.

The help file can be found at

https://docs.moodle.org/en/Gapfill_question_type#The_Gapfill_Question_Type

My motivation in creating the gapfill question type was a frustration with the syntax of the existing Embedded Answers (Cloze) question type. The syntax for this question type would require the following

This represents a minimum of eight characters including six items of punctuation for each field to create the question, as opposed to my two items of punctuation for the gapfill question type. If you want to create wrong/distractor options such as for dropdown questions the syntax becomes more complex e.g.

The {1:MC:=cat~dog} sat on the {1:MC:~rug~=mat}

The complexity of the syntax put me off this question type even though I have spent much of my life as a programmer so I should be used to arbitrary punctuation syntax.

Answerdisplay Options

There are three ways of showing the prompts or answers, these are gapfill,dropdown and dragdrop. Gapfill means no prompts and the answers must be typed in. The dropdown display shows a list of all possible answers for all questions in each field and dragdrop shows a list of all possible answers in a row above the question which can be dragged into each gap.

The list of all possible (correct) answers can be supplemented by some wrong answers that can act as distractors. These are shuffled at random within the correct answers every time a question appears in an instance of the quiz (so different students will see the answers shuffled in a different way)

The dragdrop action uses Javascript and it has been written to work with mobile devices such as Apple iOS and Android. The user can still simply type the words into the fields in dragdrop mode.

Wildcard usage

Wildcards are supported, which makes sense in gapfill mode. This allows for the acceptance of variations on the spelling of words. For example if you had students from mixed US and UK spelling background you could enter an answer that would accept colour or color as acceptable answers. This would involve the use of the field [colo?.r] As ? Acts as a single character wildcard and the dot refers to any character. It will accept any standard regular expression so you could use a complex regular expression to define a variety of characters. However this ability goes against the spirit of the question type which is designed to make creating questions easy for the teacher.

Delimitchars

There are situations where square braces [ ] may have special significance such as in programming language tests. To allow them to be part of the question and not the field delimiter you can switch to alternative characters on a per question basis. Currently the alternative choices are { }, # # and @@. It is possible to add additional choices through the plugin administration interface.