Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Embedded Answers (Cloze) question type.

Embedded Answers (Cloze) question type: Difference between revisions

From MoodleDocs
Line 28: Line 28:
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;''). If you want to have Mathematical symbols there can be problems with the \ used in TeX expressions. One alternative can be to use [[unicode]] characters.  
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;''). If you want to have Mathematical symbols there can be problems with the \ used in TeX expressions. One alternative can be to use [[unicode]] characters.  


Please note that this does not cover the [[Numerical]] type question.
See the notes further down about numerical embedded question!


==Detailed syntax explanations==
==Detailed syntax explanations==

Revision as of 14:17, 26 April 2007



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.

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;). If you want to have Mathematical symbols there can be problems with the \ used in TeX expressions. One alternative can be to use unicode characters.

See the notes further down about numerical embedded 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. In some browsers (For example IE5.5) the form fields can cover part of the feedback windows. It can help to not have the formfields for the answers too close to each other.
  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)

Numerical CLOZE questions

From the student perspective, a numerical CLOZE question looks just like a short-answer question or fill in the blanks.

The difference is that numerical answers are allowed to have an accepted error. This allows a continuous range of answers to be set. You can also express your answer in some different numerical formats. 23.4 23,4 (some countries use , as a decimal separator) and 2.34E+1 (meaning 2.34*10^1) would be interpretted as the same.

More examples:	 
0.5 accepts .5 0.5 ,5 0,5 0.500 5e-1 5E-1 but not 1/2 50% 	 
50% accepts 50% 50.0% 5E1% 50/100 even 50/1000 50 but not 500/1000 0.5	 
1/2 accepts 1/2 1/3 1twenty but not 2/4 0.5 0,5 3/6 50% ½	 
½ accepts ½	 
HALF doesn't even accept HALF (maybe 0?)	 

If you want to accept several variants you can have them in the same {} but be careful, notice the "false positives" in bold! The writing of a NUMERICAL CLOZE question is about the same as the other CLOZE questions and they can be mixed in the same question.

You write your question/incomplete text and where the student is to enter the numerical answer you write (Preferably in the source code mode, the RTF/WSIWYG editor can insert linebreaks that make the question not function. So the linebreak is for readability in the example box below. A problem with these questions is the readability of the code! ):

{2:NUMERICAL:=23.8:0.1#Feedback for correct answer 23.8	 
~%50%23.8:2#Feedback for ½credit near correct answer}. 	 

In this example

  • 2: is the question point weight which would say that this question has twice the weight in the final point(s) for this question as other partial answers with weight 1 (or no declared weight you can start {: for weight 1) in the same question.
  • NUMERICAL: says what kind of question it is. It must be in CAPS.
  • =23.8:0.1 = or %100% means correct if the answer is 23.8 with an accepted error of 0.1, then any number between 23.7 and 23.9 will be accepted as correct. (In the GIFT numerical question one can express an interval like this 13..15 or 14:1 but in CLOZE only 14:1 works.)
  • #Feedback for correct answer 23.8 is preceded by #
  • ~%50%23.8:2 ~ is the separator for answer alternatives %50% means this answer would get 50% of the score that the more precise answer had gotten. Because the tolerans here is 2, 21.8 to 25.8 would get this point and feedback

The feedback (which is seen as OverLib popup windows when the user hovers over the answer space) is formatable with HTML tags. For example if you want an exponent, surround it with superscript tags: <sup> </sup>. You can even include pictures in the feedback popup but you must clean out all " and save while still in code mode (not RTF). This works in feedback popup:

#See this picture:<br><img src=Something.gif />}	 

but not

#See this picture:<br><img src="Something.gif" />}	 

(ALGEBRA and TEX filters don't work in the feedback popups, but they can be very useful in the question writing for math/science expressions). But you can use [unicode] characters.

If you want to give feedback for any answer that didn't fit the intervals you already have specified feedback for, add some BIG general intervals, like for positive answers (if they aren't bigger than 20000 you could add:

~%0%10000.0001:10000#Feedback for unspecified not_right answers}	 

This would give feedback for anything from 0.0001 to 20000.0001 (that hadn't already gotten feedback). I didn't want to include 0 since that special case as well as negative ought to have specific reactions.

~%0%0#Hey! It can't be zero	 
~%0%-10000.0001:10000#We just want the size here,	 
so a negative value is not what we want}			 

Numerical questions can (could before 1.7?) also have case-insensitive non-numerical answers. This is useful whenever the answer for a numerical question is something like +inf, -inf, (N/A, NaN etc though I don't know when that would be useful)

See also

This information was drawn from: