Details
Description
There is an apostrophe problem in the display of a SHORTANSWER question embedded inside CLOZE question, e.g.
Rewrite "the book of John" using a genitive {1:SHORTANSWER:~%100%John's book#ok}
When student enters "John's book", the displayed output is "John\'s book", with an added unwanted backslash. And each subsequent click on the Submit page button adds more backslashes: "John
's book", "John\\\'s book", "John\\\\'s book", etc.
Joseph
Issue Links
| This issue is duplicated by: | ||||
| MDL-6675 | Backslashes inserted into short answer fields of a multianswer/cloze question |
|
|
|
Suggested bug fix:
simply add a stripslashes command:
RCS file: /cvsroot/moodle/moodle/question/type/multianswer/questiontype.php,v
retrieving revision 1.7.2.5
diff -u -r1.7.2.5 questiontype.php
— question/type/multianswer/questiontype.php 18 Aug 2006 10:28:15 -0000 1.7.2.5
+++ question/type/multianswer/questiontype.php 29 Aug 2006 21:00:22 -0000
@@ -225,6 +225,7 @@
$inputname = $nameprefix.$positionkey;
$response = isset($state->responses[$positionkey])
? $state->responses[$positionkey] : null;
+ $response = stripslashes($state->responses[$positionkey]);
// Determine feedback popup if any
Tim, can you please check this? Thanks.