Index: questiontype.php =================================================================== RCS file: /cvsroot/moodle/moodle/question/type/questiontype.php,v retrieving revision 1.74.2.31 diff -u -r1.74.2.31 questiontype.php --- questiontype.php 23 Feb 2010 14:31:09 -0000 1.74.2.31 +++ questiontype.php 10 Jul 2010 21:38:23 -0000 @@ -1769,7 +1769,14 @@ array_shift($extraquestionfields); $expout=''; foreach ($extraquestionfields as $field) { - $expout .= " <$field>{$question->options->$field}\n"; + $exportedvalue=$question->options->$field; + if (!empty($exportedvalue) && htmlspecialchars($exportedvalue)!=$exportedvalue) { + $exportedvalue = ''; + } + if (strpos($exportedvalue,'\'')!=false) { + $exportedvalue = ''.$exportedvalue.''; + } + $expout .= " <$field>{$exportedvalue}\n"; } $extraasnwersfields = $this->extra_answer_fields();