diff --git a/question/format/gift/format.php b/question/format/gift/format.php index 0bfc0381ea5..fcfa2367220 100644 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -761,10 +761,6 @@ class qformat_gift extends qformat_default { // 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))); } } diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 4f7b4a6ac4a..b713595cc61 100644 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -1095,6 +1095,7 @@ class qformat_xml extends qformat_default { public function writequestion($question) { global $CFG, $OUTPUT; + $invalidquestion = false; $fs = get_file_storage(); $contextid = $question->contextid; // Get files used by the questiontext. @@ -1402,11 +1403,12 @@ class qformat_xml extends qformat_default { 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. @@ -1427,8 +1429,11 @@ class qformat_xml extends qformat_default { // close the question tag $expout .= " \n"; - - return $expout; + if ($invalidquestion) { + return ''; + } else { + return $expout; + } } public function write_answers($answers) {