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 11 Aug 2010 17:01:04 -0000 @@ -1732,7 +1732,7 @@ $qo->qtype = $question_type; foreach ($extraquestionfields as $field) { - $qo->$field = $format->getpath($data, array('#',$field,0,'#'), $qo->$field); + $qo->$field = addslashes($format->getpath($data, array('#',$field,0,'#'), $qo->$field)); } // run through the answers @@ -1769,7 +1769,11 @@ 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 = ''; + } + $expout .= " <$field>{$exportedvalue}\n"; } $extraasnwersfields = $this->extra_answer_fields();