-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
1.6.2
-
None
-
Linux, PHP 5.0.4, MySQL 4.1.20, Apache 2.0.54, Moodle latest 1.6.2+
-
MOODLE_16_STABLE
If an apostrophe (ASCII character 39) is entered into a short answer field of a multianswer (cloze) question, and the answer is then either submitted individually (using the adaptive mode) OR saved without submitting with other answers displayed on a quiz page, there is a backslash character inserted in front of the apostrophe each time the quiz page is reloaded.
Example:
[SHORTANSWER FIELD]: Boys' Orchestra
- Save without submitting (1)
[SHORTANSWER FIELD]: Boys\' Orchestra - Save without submitting (2)
[SHORTANSWER FIELD]: Boys\\\' Orchestra - Save without submitting (3)
[SHORTANSWER FIELD]: Boys\\\\\\\' Orchestra
What I did was to add a stripslashes() into the question\type\multianswer\questiontype.php file – as shown below. I do not know though whether I should consider this solution systematic or robust enough.
— ORIGINAL question\type\multianswer\questiontype.php Sat Sep 23 16:52:53 2006
+++ MODIFIED question\type\multianswer\questiontype.php Sat Sep 23 17:35:33 2006
@@ -304,7 +304,7 @@
case 'shortanswer':
case 'numerical':
echo " <input $style $readonly $popup name=\"$inputname\"
- type=\"text\" value=\"$response\" size=\"12\" /> ";
+ type=\"text\" value=\"".stripslashes($response)."\" size=\"12\" /> ";
break;
case 'multichoice':
$outputoptions = '<option></option>'; // Default empty option
- duplicates
-
MDL-6386 Apostrophe problem in SHORTANSWER question embedded inside CLOZE question
-
- Closed
-