Permalink
Browse files

Merge branch 'MDL-32201_21' of git://github.com/timhunt/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
2 parents 50cc39f + 5b662f3 commit 9807bef7c775826c69aaa9ab5ff70521f4d45aa5 @danpoltawski danpoltawski committed Apr 2, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −9 question/type/questiontypebase.php
@@ -1005,21 +1005,15 @@ public function export_to_xml($question, $format, $extra=null) {
array_shift($extraanswersfields);
}
foreach ($question->options->answers as $answer) {
- // TODO this should be re-factored to use $format->write_answer().
- $percent = 100 * $answer->fraction;
- $expout .= " <answer fraction=\"$percent\" {$format->format($answer->answerformat)}>\n";
- $expout .= $format->writetext($answer->answer, 3, false);
- $expout .= " <feedback {$format->format($answer->feedbackformat)}>\n";
- $expout .= $format->writetext($answer->feedback, 4, false);
- $expout .= " </feedback>\n";
+ $extra = '';
if (is_array($extraanswersfields)) {
foreach ($extraanswersfields as $field) {
$exportedvalue = $format->xml_escape($answer->$field);
- $expout .= " <{$field}>{$exportedvalue}</{$field}>\n";
+ $extra .= " <{$field}>{$exportedvalue}</{$field}>\n";
}
}
- $expout .= " </answer>\n";
+ $expout .= $format->write_answer($answer, $extra);
}
return $expout;
}

0 comments on commit 9807bef

Please sign in to comment.