Note: You are currently viewing documentation for Moodle 2.2. Up-to-date documentation for the latest stable version is available here: Cloze.

Cloze: Difference between revisions

From MoodleDocs
Line 9: Line 9:
==Format==
==Format==


The Moodle [http://moodle.org/help.php?module=quiz&file=multianswer.html help documentation for Cloze questions] gives an example. Peter Ruthven-Stuart advises, "I found the best way to learn how to make the Cloze type questions was to copy the example in the above link, and then make small changes to the example until I broke it."
The Moodle [http://moodle.org/help.php?module=quiz&file=multianswer.html help documentation for Cloze questions] gives an example.
 
The number appearing at the beginning of a 'blank' indicates the weighting for the question, and is nothing to do with the question number. So, in the example below the blank has been given a weight of '2'. So, if the blanks all have an equal weight, you don't need to type any number.
 
{2:SHORTANSWER:%100%CALL#Yes, that's it!~%0%?#What should I __ you? Either lower or UPPER case is OK.}


NB: Be careful when copying a cloze type question into the WYSIWYG HTML editor, as line breaks tend to get added, which destroys the question.
NB: Be careful when copying a cloze type question into the WYSIWYG HTML editor, as line breaks tend to get added, which destroys the question.


Joseph Rézeau provided the following examples and the detailed explanation of the syntax.
===Some examples===


Match the following cities with the correct state:
Match the following cities with the correct state:
Line 26: Line 22:
* Phoenix: {1:MULTICHOICE:%0%California#Wrong~=Arizona#OK}
* Phoenix: {1:MULTICHOICE:%0%California#Wrong~=Arizona#OK}


The capital of France is {1:SHORTANSWER:=Paris#Congratulations!~%50%Marseille#No, that is the second largest city in France (after Paris).~.*#Wrong answer. The capital of France is Paris, of course.} Note! This example only works in Moodle 1.5.2, see the point 12 below.
The capital of France is {1:SHORTANSWER:=Paris#Congratulations!~%50%Marseille#No, that is the second largest city in France (after Paris).~*#Wrong answer. The capital of France is Paris, of course.}.


If the correct answer contains { } # ~ / " or \ you will have to escape them by putting a \ in front of each such character. In the feedback ~ and } must be escaped otherwise it will be interpreted as ''the next answer'' or ''end of the short answer section'' respectively. Quotation signs: " can lead to trouble anyhow in both places. Perhaps one can use two single quotes: <nowiki>''</nowiki> or the HTML code: <nowiki>&q uot;</nowiki> ''(without the space)''.   
If the correct answer contains { } # ~ / " or \ you will have to escape them by putting a \ in front of each such character. In the feedback ~ and } must be escaped otherwise it will be interpreted as ''the next answer'' or ''end of the short answer section'' respectively. Quotation signs: " can lead to trouble anyhow in both places. Use the HTML entity: & quot; (without the space between ''&'' and ''quot;'').   


Please note that this does not cover the [[Numerical]] type question.
Please note that this does not cover the [[Numerical]] type question.
 
===Detailed syntax explanations===
# all question items within a cloze-type question are coded inside curled braces { }
# all question items within a cloze-type question are coded inside curled braces { }
# the number which appears between the opening brace and the colon {1: is the weighting of that item; if it is set at 1 for all the items, it needs not be specified, so you can have {:
# the number which appears between the opening brace and the colon {1: is the weighting of that item; if it is set at 1 for all the items, it needs not be specified, so you can have {:
# after the colon we have the item type: MULTICHOICE, SHORTANSWER, NUMERICAL
# after the colon we have the item question type: MULTICHOICE, SHORTANSWER, NUMERICAL
# '''NOTE'''.- If you have installed the [http://moodle.org/mod/data/view.php?d=13&rid=338 REGEXP question type plugin] you can also use the REGEXP question type
# the syntax for MULTICHOICE and SHORTANSWER is the same; the only difference is in the displaying of the item to the student
# the syntax for MULTICHOICE and SHORTANSWER is the same; the only difference is in the displaying of the item to the student
# the order of the various answers is indifferent (except if you want a catch-all for wrong answers, see #12 below)
# the order of the various answers is indifferent (except if you want a catch-all for wrong answers, see #12 below)
Line 42: Line 39:
# all answers except the first one are separated from one another by the tilde ~ sign
# all answers except the first one are separated from one another by the tilde ~ sign
# answers can be followed by an optional feedback message, preceded with the # sign; if there is no feedback message, the # sign can be present or absent, it does not matter
# answers can be followed by an optional feedback message, preceded with the # sign; if there is no feedback message, the # sign can be present or absent, it does not matter
# note that the feedback message is displayed in a small popup window (if and when feedback has been declared accessible to the students in the Quiz settings) upon mouse hovering. The popup window has a title "feedback" and you can use HTML tags to format your feedback. In several browsers, including IE6, the feedback popup can be hidden by formelements, like other CLOZE fields: [[Image:ClozeFeedbackPopupFaultIE6.gif|Popup covered by dropdown in next line. Återkoppling=Swedish for feedback]]. It can be good to have some (even empty) lines above next CLOZE field. Firefox (at least 1.5+) does not have this problem.
# note that the feedback message is displayed in a small popup window (if and when feedback has been declared accessible to the students in the Quiz settings) upon mouse hovering. The popup window has a title "feedback" and you can use HTML tags to format your feedback.
# in the SHORTANSWER type you may want to put a catch-all (wrong) answer in order to send a "wrong, try again" feedback; you can do this by inserting .* as a wrong answer; this does not work in Moodle 1.5, 1.5.3 and 1.6; it works in version 1.5.2 only; see my post here
# in the SHORTANSWER type you may want to put a catch-all (wrong) answer in order to send a "wrong, try again" feedback; you can do this by inserting an asterisk '''*''' as '''the very last expected answer''' in your formula
# unfortunately in MULTICHOICE MODE it is not possible to get the answers to be scrambled
# unfortunately in MULTICHOICE MODE it is not possible to get the answers to be scrambled
# unfortunately in SHORTANSWER mode it is not possible to make the answers case-sensitive (except by using a workaround which I will make explain in a further post in [http://moodle.org/mod/forum/discuss.php?d=36430&parent=170308 this thread])
# unfortunately in SHORTANSWER mode it is not possible to make the answers case-sensitive except by using a workaround explained in [http://moodle.org/mod/forum/discuss.php?d=36430&parent=170308 this thread])
# 1.5.3 (at least) crashes when a tilde (') is inserted in any part of the question text. When replaced by a (´) everything works fine.


==See also==
==See also==

Revision as of 13:03, 30 June 2006

Embedded answers (Cloze) questions consist of a passage of text (in Moodle format) that has various answers embedded within it, including multiple choice, short answers and numerical answers.

There is currently no graphical interface to create these questions - you need to specify the question format using the text box or by importing them from external files.

Lots of people suggest that Hot Potatoes software is the easiest way to create Embedded answer (Cloze) questions. Once you have created your questions on your PC, you can then import them into into Moodle's quiz module.

Import Limitation: You can only import one Embedded Answer question at a time. So if you were thinking of creating a .txt file to import several of these questions at one time it won't work.

Format

The Moodle help documentation for Cloze questions gives an example.

NB: Be careful when copying a cloze type question into the WYSIWYG HTML editor, as line breaks tend to get added, which destroys the question.

Some examples

Match the following cities with the correct state:

  • San Francisco: {1:MULTICHOICE:=California#OK~Arizona#Wrong}
  • Tucson: {1:MULTICHOICE:California#Wrong~%100%Arizona#OK}
  • Los Angeles: {1:MULTICHOICE:=California#OK~Arizona#Wrong}
  • Phoenix: {1:MULTICHOICE:%0%California#Wrong~=Arizona#OK}

The capital of France is {1:SHORTANSWER:=Paris#Congratulations!~%50%Marseille#No, that is the second largest city in France (after Paris).~*#Wrong answer. The capital of France is Paris, of course.}.

If the correct answer contains { } # ~ / " or \ you will have to escape them by putting a \ in front of each such character. In the feedback ~ and } must be escaped otherwise it will be interpreted as the next answer or end of the short answer section respectively. Quotation signs: " can lead to trouble anyhow in both places. Use the HTML entity: & quot; (without the space between & and quot;).

Please note that this does not cover the Numerical type question.

Detailed syntax explanations

  1. all question items within a cloze-type question are coded inside curled braces { }
  2. the number which appears between the opening brace and the colon {1: is the weighting of that item; if it is set at 1 for all the items, it needs not be specified, so you can have {:
  3. after the colon we have the item question type: MULTICHOICE, SHORTANSWER, NUMERICAL
  4. NOTE.- If you have installed the REGEXP question type plugin you can also use the REGEXP question type
  5. the syntax for MULTICHOICE and SHORTANSWER is the same; the only difference is in the displaying of the item to the student
  6. the order of the various answers is indifferent (except if you want a catch-all for wrong answers, see #12 below)
  7. a correct answer is preceded with the equal sign = or a percentage (usually %100%)
  8. a wrong answer is preceded with nothing or a percentage (usually %0%)
  9. you can allocate some points between 0 and 100 to some answers, if you put the appropriate percentage
  10. all answers except the first one are separated from one another by the tilde ~ sign
  11. answers can be followed by an optional feedback message, preceded with the # sign; if there is no feedback message, the # sign can be present or absent, it does not matter
  12. note that the feedback message is displayed in a small popup window (if and when feedback has been declared accessible to the students in the Quiz settings) upon mouse hovering. The popup window has a title "feedback" and you can use HTML tags to format your feedback.
  13. in the SHORTANSWER type you may want to put a catch-all (wrong) answer in order to send a "wrong, try again" feedback; you can do this by inserting an asterisk * as the very last expected answer in your formula
  14. unfortunately in MULTICHOICE MODE it is not possible to get the answers to be scrambled
  15. unfortunately in SHORTANSWER mode it is not possible to make the answers case-sensitive except by using a workaround explained in this thread)

See also

This information was drawn from: