]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18555:
authorthepurpleblob <thepurpleblob>
Mon, 16 Mar 2009 14:25:30 +0000 (14:25 +0000)
committerthepurpleblob <thepurpleblob>
Mon, 16 Mar 2009 14:25:30 +0000 (14:25 +0000)
Adding better handling for unsupported question types.

Merged from STABLE_19

lang/en_utf8/qformat_xml.php [new file with mode: 0644]
question/format/xml/format.php

diff --git a/lang/en_utf8/qformat_xml.php b/lang/en_utf8/qformat_xml.php
new file mode 100644 (file)
index 0000000..062bf3e
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$string['invalidxml'] = 'Invalid xml file - string expected (use CDATA?)';
+$string['unsupportedexport'] = 'Question type $a is not supported by xml export';
+?>
index 8f8edad9cf9e0d1dac12f1daa6ba06210709325a..787e8af8f242f4cd1d96c56f14c0ea751906a6af 100755 (executable)
@@ -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;
         }