Permalink
Browse files

MDL-28426 question export should write answer and feedback format to …

…the file.
  • Loading branch information...
1 parent 919e659 commit 537114c6cce43ab222c65ccc6fe784ee9bd69f86 Roger Moore committed with timhunt Oct 31, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 question/type/questiontype.php
@@ -1609,9 +1609,11 @@ function export_to_xml($question, $format, $extra=null) {
} else {
foreach ($question->options->answers as $answer) {
$percent = 100 * $answer->fraction;
- $expout .= " <answer fraction=\"$percent\">\n";
+ $ansformat = $format->get_format($answer->answerformat);
+ $fbformat = $format->get_format($answer->feedbackformat);
+ $expout .= " <answer fraction=\"$percent\" format=\"{$ansformat}\">\n";
$expout .= $format->writetext($answer->answer, 3, false);
- $expout .= " <feedback>\n";
+ $expout .= " <feedback format=\"{$fbformat}\">\n";
$expout .= $format->writetext($answer->feedback, 4, false);
$expout .= " </feedback>\n";
$expout .= " </answer>\n";

0 comments on commit 537114c

Please sign in to comment.