Adding better handling for unsupported question types.
Merged from STABLE_19
--- /dev/null
+<?php
+$string['invalidxml'] = 'Invalid xml file - string expected (use CDATA?)';
+$string['unsupportedexport'] = 'Question type $a is not supported by xml export';
+?>
}
if ($istext) {
if (!is_string($xml)) {
- $this->error( 'Invalid xml file - string expected (use CDATA?)' );
+ $this->error( get_string('invalidxml','qformat_xml') );
}
$xml = trim( $xml );
}
default:
// try support by optional plugin
if (!$data = $this->try_exporting_using_qtypes( $question->qtype, $question )) {
- print_error('unknowquestiontype', '', '', $question->qtype );
+ notify( get_string( 'unsupportedexport','qformat_xml',$QTYPES[$question->qtype]->local_name() ) );
}
$expout .= $data;
}