]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18390:
authorthepurpleblob <thepurpleblob>
Tue, 3 Mar 2009 15:36:17 +0000 (15:36 +0000)
committerthepurpleblob <thepurpleblob>
Tue, 3 Mar 2009 15:36:17 +0000 (15:36 +0000)
Correctly report unhandled question types and get string from language pack.

lang/en_utf8/qformat_gift.php [new file with mode: 0644]
question/format/gift/format.php

diff --git a/lang/en_utf8/qformat_gift.php b/lang/en_utf8/qformat_gift.php
new file mode 100644 (file)
index 0000000..45a379e
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+$string['nohandler'] = 'No handler for question type $a';
+?>
index 43c8d7d544f5c998cf4e434246107d4ded178b66..c7d13b9de4fecd1f759043f766dcdef92c0b25a2 100755 (executable)
@@ -640,19 +640,14 @@ function writequestion( $question ) {
         }
         $expout .= "}\n";
         break;
-    case DESCRIPTION:
-        $expout .= "// DESCRIPTION type is not supported\n";
-        break;
-    case MULTIANSWER:
-        $expout .= "// CLOZE type is not supported\n";
-        break;
     default:
         // check for plugins
         if ($out = $this->try_exporting_using_qtypes( $question->qtype, $question )) {
             $expout .= $out;
         }
         else {
-            notify("No handler for qtype '$question->qtype' for GIFT export" );
+            $expout .= "Question type $question->qtype is not supported\n";
+            notify( get_string('nohandler','qformat_gift',$question->qtype ) );
         }
     }
     // add empty line to delimit questions