From c95defa90bc7ba72377c5ed156a806e1d49fb64c Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Mon, 16 Mar 2009 14:25:30 +0000 Subject: [PATCH] MDL-18555: Adding better handling for unsupported question types. Merged from STABLE_19 --- lang/en_utf8/qformat_xml.php | 4 ++++ question/format/xml/format.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 lang/en_utf8/qformat_xml.php diff --git a/lang/en_utf8/qformat_xml.php b/lang/en_utf8/qformat_xml.php new file mode 100644 index 0000000000..062bf3ea89 --- /dev/null +++ b/lang/en_utf8/qformat_xml.php @@ -0,0 +1,4 @@ + diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 8f8edad9cf..787e8af8f2 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -106,7 +106,7 @@ class qformat_xml extends qformat_default { } 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 ); } @@ -1003,7 +1003,7 @@ class qformat_xml extends qformat_default { 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; } -- 2.39.5