$course$/Default for GFT2 Alternative_Delimiters This question is designed to demonstrate that the gaps can be delimited by characters other than the default square braces. This is useful for questions about programming languages for example where the questions are about arrays in a language that uses square braces. Enter 1 into the gap for the first try to see the hints.

Make the following php code print out the string "cat"

$ar= array('cat','mat');
print $ar[{0}];

 

]]>
1.0000000 0.3333333 0 gapfill {} 0 0 0 0 {} gapfill 0 0 0 Correct!

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Hint:What number do array places count from?

]]>
Hint:Remember that php arrays count from zero not one (like most programming languages)

]]>
AnyOrderDDrop The question uses the no duplicates option. This means a field may accept a range of words but if the same word is entered into more than one field it will only gain one mark for that word. The question syntax uses using the broken bar | operator to indicate the or operation, i.e. the answer can be this or that. So here it has been entered as [gold|silver|bronze] . Here is the question.

What are the medals that can be won in the olympic games?

Enter the same value twice or, e.g. gold, gold, silver. It will mark all answers correct with a tick, but if you notice the score will be 2 rather than three.

{gold|silver|bronze} {gold|silver|bronze} {gold|silver|bronze}

]]>
3.0000000 0.3333333 0 dragdrop {} 0 1 0 gold|silver|bronze gold|silver|bronze gold|silver|bronze brown pink green {} dragdrop 0 1 0 Your answer is partially correct. Note how the actual mark matches the number of unique correct answers whatever the number of ticks is.

]]>
Your answer is incorrect.

]]>
Have another go

]]>
Try again

]]>
AnyOrderDragDropGroups You can offer groups of answer fields to be dragged in its appropriate category or group. For example a language teacher might offer words that are dragged into the gender categories or biologists could offer options to be dragged into the categories of animals, e.g. canine, feline and bovine. The key to this is using the | (or) operator. 

CanineFelineBovine
[wolf|dog|dingo] [lion|tiger|lynx] [buffalo|yak|antelope]
[wolf|dog|dingo] [lion|tiger|lynx] [buffalo|yak|antelope]
[wolf|dog|dingo] [lion|tiger|lynx] [buffalo|yak|antelope]

 

 

 

 

]]>
9.0000000 0.3333333 0 dragdrop [] 0 1 0 wolf|dog|dingo lion|tiger|lynx buffalo|yak|antelope wolf|dog|dingo lion|tiger|lynx buffalo|yak|antelope wolf|dog|dingo lion|tiger|lynx buffalo|yak|antelope rat swallow kangaroo [] dragdrop 0 1 0 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Try again

]]>
Have another go

]]>
AnyOrderGapfill The question uses the no duplicates option. This means a field may accept a range of words but if the same word is entered into more than one field it will only gain one mark for that word. The question syntax uses using the broken bar | operator to indicate the or operation, i.e. the answer can be this or that. So here it has been entered as [gold|silver|bronze] . Here is the question.

What are the medals that can be won in the olympic games?

Enter the same value twice or, e.g. gold, gold, silver. It will mark all answers correct with a tick, but if you notice the score will be 2 rather than three.

{gold|silver|bronze} {gold|silver|bronze} {gold|silver|bronze}

]]>
3.0000000 0.3333333 0 gapfill {} 0 1 0 gold|silver|bronze gold|silver|bronze gold|silver|bronze {} gapfill 0 1 0 Your answer is partially correct. Note how the actual mark matches the number of unique correct answers whatever the number of ticks is.

]]>
Your answer is incorrect.

]]>
Have another go

]]>
Try again

]]>
CaseSensitive The complete phrase is "The cat sat on the mat", This version case the case sensitivity option checked so the words cat and mat must be entered as Cat and Mat.

The [Cat] sat on the [Mat]

]]>
2.0000000 0.3333333 0 gapfill [] 1 0 0 Cat Mat [] gapfill 1 0 0 Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Disable RegEx for Math, HTML and Code questions This question has disabled regular expressions. This means that special characters used in regular expressions such as < / * . etc  will have no meaning which can be useful when creating questions for maths and programming or HTML (which of course uses the < and > characters extensively).

2[+]2=4
4[/]2=2

The option for disable regex can be found in the More Options in the question editing form.

Complete the syntax for this for loop in PHP

for($i=0;$i[<]10;$++){

print($i);

}

 

 

]]>
3.0000000 0.3333333 0 dragdrop [] 0 0 1 + / [] dragdrop 0 0 1 Yes,  you can see how this does a plain text search and disables regular expressions ]]> Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Have another go

]]>
One more try

]]>
DragAndDrop The complete phrase is "The cat sat on the mat". This question has been created simply by surrounding the "missing" words with square braces like this

The [cat] sat on the [mat]

Although this is a "drag and drop" version, you can simply type into the fields, which may be useful when using a mobile browser.

Drag the correct words into the gaps.

The {cat} sat on the {mat}

]]>
This text is from the general feedback section of the question editing form.

]]>
2.0000000 0.3333333 0 dragdrop {} 0 0 0 cat mat rat bat rug hat {} dragdrop 0 0 0 This tick graphic and text is from the Combined Feedback section "For Any correct response" section of the editing form

]]>
Your answer is partially correct.

]]>
Your answer is incorrect. You need to brush up on your knowledge of feelines in the domestic sphere.

]]>
Hint1: The answer refers to a feline and a floor covering. Note how the incorrect answers are cleared after you press the try again button. This hint DOES show the number of correct answers and so each field has an indicator of correctness or incorrectness via tick/cross colour

]]>
Hint2: The answer refers to a domestic feline and a floor covering that rhymes with bat. The show number of correct responses option is not ticked for this.

]]>
DropDownMathSymbols This demonstrates comparing basic maths symbols and depends on DisableRegex (regular expressions) being checked.

What is the greater than symbol [>]

What is the less than symbol [<]

What is the addition symbol [+]

What is the minus symbol [-]

What is the multiply symbol [*]

 

]]>
5.0000000 0.3333333 0 dropdown [] 0 0 1 + - * ! ? [] dropdown 0 0 1 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
DropDowns

 

The complete phrase is "The cat sat on the mat", but this time the word options are in dropdowns.

The [cat] sat on the [mat]

 

]]>
2.0000000 0.3333333 0 dropdown [] 0 0 0 cat mat bat rug [] dropdown 0 0 0 Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Have another go. There is no indication of what answers are correct or incorrect because the show the number of correct responses box is not checked in hint 1.

]]>
One last time. The Show the number of correct responses box was checked and so you have the background colour and symbols (tick/cross) to indicate which answers were correct.

]]>
Gapfill (no prompts) The complete phrase is "The cat sat on the mat", This version has no prompts (i.e. no dragdrop or dropdowns displayed).

The [cat] sat on the [mat]

]]>
2.0000000 0.3333333 0 gapfill [] 0 0 0 cat mat [] gapfill 0 0 0 Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Have another go

]]>
One last try

]]>
Maths Operators What is the greater than sign [>]

What is the less than sign [<]

What is the addition symbol [+]

What is the subtraction symbol [-]

What is the multiplication symbol? [*]

]]>
5.0000000 0.3333333 0 dropdown [] 0 0 1 + - * ! ? / \ [] dropdown 0 0 1 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Multi Word Answers This illustrates answers containing more than one word

The answer is "the black cat sat on the soft mat"

The [black cat] sat on the [soft mat]

]]>
2.0000000 0.3333333 0 gapfill [] 0 0 0 black cat soft mat [] gapfill 0 0 0 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
RegularExpressions This question illustrates that following a letter with a question mark ? will make it optional. The following gap will accept colours, colour, colors and colors as correct answers, so allowing both US and UK spelling of the word. If you look at the source of this question this gap contains colou?rs?

Red, Green and Blue are examples of {colou?rs?}

This gap illustrates how you can "escape" the special characters used in regular expressions such as the dollar sign by preceeding them with a backslash i.e. \$.  The correct answer for this gap is the $ symbol.

The special character that indicates the start of a variable in PHP is the {\$} sign. (enter the $ sign)

The HTML tag to start a paragraph is {\<p\>}  (enter <p>)

Note there is an option under more options to switch off regular expression for the whole question, but escaping is useful where you need some regex processing.

You can ensure any spare spaces between words are ignored with \s

The correct answer here is black and white but it will accept the words with one or more spaces between them {black\s+and\s+white}.

Moodle has two short answer question types that support regular expressions

Preg

http://docs.moodle.org/25/en/question/type/preg

and

Regular Expression Short Answer

https://moodle.org/plugins/view.php?plugin=qtype_regexp

 

]]>
4.0000000 0.3333333 0 gapfill {} 0 0 0 colou?rs? \$ black\s+and\s+white {} gapfill 0 0 0 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
Troubleshooting You can troubleshoot a question by clicking the "fill in correct responses" button in preview mode.

This question does not [work] because there are hidden html tags within the field, you can view (and delete) the hidden div tags by clicking the HTML button on the editor bar.

]]>
1.0000000 0.3333333 0 dragdrop [] 0 0 0 work]]> [] dragdrop 0 0 0 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>
UsingCommas Answers may contain commas and commas can be used in distractors by escaping them with the backslash like this \,

What are the colors of the French flag?

It's [ blue, white, red ]

]]>
1.0000000 0.3333333 0 dragdrop [] 0 0 1 blue, white, red orange\, white\, red green\, white\, black [] dragdrop 0 0 1 Your answer is correct.

]]>
Your answer is partially correct.

]]>
Your answer is incorrect.

]]>