Skip to content

Commit

Permalink
Merge branch 'MDL-39283' of git://github.com/jmvedrine/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 24, 2013
2 parents 088c261 + b31d666 commit ba26ed9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 0 additions & 4 deletions question/format/gift/format.php
Expand Up @@ -763,10 +763,6 @@ public function writequestion($question) {
// Check for plugins
if ($out = $this->try_exporting_using_qtypes($question->qtype, $question)) {
$expout .= $out;
} else {
$expout .= "Question type $question->qtype is not supported\n";
echo $OUTPUT->notification(get_string('nohandler', 'qformat_gift',
question_bank::get_qtype_name($question->qtype)));
}
}

Expand Down
15 changes: 10 additions & 5 deletions question/format/xml/format.php
Expand Up @@ -1099,6 +1099,7 @@ protected function presave_process($content) {
public function writequestion($question) {
global $CFG, $OUTPUT;

$invalidquestion = false;
$fs = get_file_storage();
$contextid = $question->contextid;
// Get files used by the questiontext.
Expand Down Expand Up @@ -1410,11 +1411,12 @@ public function writequestion($question) {
break;

default:
// try support by optional plugin
// Try support by optional plugin.
if (!$data = $this->try_exporting_using_qtypes($question->qtype, $question)) {
notify(get_string('unsupportedexport', 'qformat_xml', $question->qtype));
$invalidquestion = true;
} else {
$expout .= $data;
}
$expout .= $data;
}

// Output any hints.
Expand All @@ -1435,8 +1437,11 @@ public function writequestion($question) {

// close the question tag
$expout .= " </question>\n";

return $expout;
if ($invalidquestion) {
return '';
} else {
return $expout;
}
}

public function write_answers($answers) {
Expand Down

0 comments on commit ba26ed9

Please sign in to comment.