CLOZE/GIFT: answer and escape chars #}"/~\

CLOZE/GIFT: answer and escape chars #}"/~\

by Jurgis Pralgauskis -
Number of replies: 3
Hi,

https://docs.moodle.org/26/en/Embedded_Answers_%28Cloze%29_question_type#Format isays

> If the correct answer contains } # ~ / " or \ you will have to escape them by putting a \ in front of each such character.

escaping of # and } works ok,  {:SHORTANSWER:=\#bla{\}}
would need entering: #bla}#


Tilde  needs to enter escape char in answer box, otherwise it doesn't work,

except for the very first character of answer -- it can be given without backslash

{:SHORTANSWER:=~~bla}
would have two answer alternatives: ~ and bla

{:SHORTANSWER:=~\~bla}
should have answer entered as ~\~bla , but not ~~bla


Backslash and quotes does not need to be escaped at all!

{:SHORTANSWER:=\ \# \\ \n \"}
answer should be entered as: \ # \\ \n \"

ps.: I have Modle 2.6

At least - wiki should be updated, I guess smile



Average of ratings: -
In reply to Jurgis Pralgauskis

Re: CLOZE/GIFT: answer and escape chars #}"/~\

by Jurgis Pralgauskis -

I found one more bug


if I indicate that short answer must be *

then it can be any symbol ;)


How can I make short answer in CLOZE to be just asterix - * ?

In reply to Jurgis Pralgauskis

Re: CLOZE/GIFT: answer and escape chars #}"/~\

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That is a features. * matches any characters in a Moodle short-answer question.

I think it works if you make the answer \*. E.g. the question

Type a * {1:SHORTANSWER:=\*}.


In reply to Tim Hunt

Re: CLOZE/GIFT: answer and escape chars #}"/~\

by Jurgis Pralgauskis -

ok, so Wiki should be updated about \* this as well smile

and there is still a problem, if I want to have answer just backslash "\"

earlier I could write it and leave space after it, but in in newest version, seems, spaces at the end of answers are not trimmed automatically. 

And if I don't leave a space after \, it escapes tilde separator and 2 answers are joined as one.. :/ 

You can try

Backslash is {1:SHORTANSWER:=\ ~=Backslash #extra space problem~=\~connected answers~\*#this is asterix~*#this is not backslash}


ps.: reported issue on this backlsash/pace at the end stuff https://tracker.moodle.org/browse/MDL-48474