Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-28426 qtype base export_to_xml does not write format.

Fix based on Roger Moore's patch.
  • Loading branch information...
commit 2dd93c071a824ed7b1ba398291b205eab0aed495 1 parent f08f22c
@timhunt timhunt authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 question/type/questiontypebase.php
View
5 question/type/questiontypebase.php
@@ -995,10 +995,11 @@ 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\">\n";
+ $expout .= " <answer fraction=\"$percent\" {$format->format($answer->answerformat)}>\n";
$expout .= $format->writetext($answer->answer, 3, false);
- $expout .= " <feedback>\n";
+ $expout .= " <feedback {$format->format($question->feedbackformat)}>\n";
$expout .= $format->writetext($answer->feedback, 4, false);
$expout .= " </feedback>\n";
if (is_array($extraanswersfields)) {
Please sign in to comment.
Something went wrong with that request. Please try again.