From 9c61c44fc1a55be5f56ea69c06d84d244360fd64 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 14 Sep 2007 09:34:52 +0000 Subject: [PATCH] MDL-11271 - The closing bracket "}" can't be used in cloze question type. Now, you can excape a closing } with a backslash. Merged from MOODLE_18_STABLE. --- question/type/multianswer/questiontype.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 155dfa497d..d66c6526f4 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -715,7 +715,8 @@ function qtype_multianswer_extract_question($text) { } } else { // Tolerance can stay undefined for non numerical questions // Undo quoting done by the HTML editor. - $wrapped->answer[] = html_entity_decode($altregs[ANSWER_ALTERNATIVE_REGEX_ANSWER], ENT_QUOTES, 'UTF-8'); + $answer = html_entity_decode($altregs[ANSWER_ALTERNATIVE_REGEX_ANSWER], ENT_QUOTES, 'UTF-8'); + $wrapped->answer[] = str_replace('\}', '}', $answer); } $tmp = explode($altregs[0], $remainingalts, 2); $remainingalts = $tmp[1]; -- 2.39.5