Merge branch 'MDL-39283_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE

This commit is contained in:
Dan Poltawski
2013-04-24 14:35:09 +01:00
2 changed files with 10 additions and 9 deletions
-4
View File
@@ -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)));
}
}
+10 -5
View File
@@ -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 .= " </question>\n";
return $expout;
if ($invalidquestion) {
return '';
} else {
return $expout;
}
}
public function write_answers($answers) {