gift import: MDL-18390 better way to get the question type name.
authortjhunt <tjhunt>
Thu, 12 Mar 2009 06:00:55 +0000 (06:00 +0000)
committertjhunt <tjhunt>
Thu, 12 Mar 2009 06:00:55 +0000 (06:00 +0000)
question/format/gift/format.php

index 6d2b7bafcca34e004b1f1f974191514283ab5c19..08a3b857fd0f72e56de77eac32f82fcf634aec76 100755 (executable)
@@ -528,6 +528,7 @@ function repchar( $text, $format=0 ) {
     }
 
 function writequestion( $question ) {
+    global $QTYPES;
     // turns question into string
     // question reflects database fields for general question and specific to type
 
@@ -647,7 +648,7 @@ function writequestion( $question ) {
         }
         else {
             $expout .= "Question type $question->qtype is not supported\n";
-            notify( get_string('nohandler','qformat_gift',get_string($question->qtype,'quiz') ) );
+            notify( get_string('nohandler', 'qformat_gift', $QTYPES[$question->qtype]->local_name()) );
         }
     }
     // add empty line to delimit questions