]> git.mjollnir.org Git - moodle.git/commitdiff
Moved check for plugin import/export to the start rather than the end
authorthepurpleblob <thepurpleblob>
Fri, 17 Aug 2007 09:47:51 +0000 (09:47 +0000)
committerthepurpleblob <thepurpleblob>
Fri, 17 Aug 2007 09:47:51 +0000 (09:47 +0000)
Merged from STABLE_18

question/format/gift/format.php

index 662b885ef7dda4843e50a4633ff84b91a1495751..f3462fed829f598175ff8cf056705cbd86928896 100755 (executable)
@@ -225,6 +225,12 @@ class qformat_gift extends qformat_default {
         // determine QUESTION TYPE
         $question->qtype = NULL;
 
+        // give plugins first try
+        // plugins must promise not to intercept standard qtypes
+        if ($question = $this->try_importing_using_qtypes( $lines, $question, $answertext )) {
+            return $question;
+        }
+
         if ($description) {
             $question->qtype = DESCRIPTION;
         }
@@ -262,10 +268,6 @@ class qformat_gift extends qformat_default {
         }
 
         if (!isset($question->qtype)) {
-            // try for plugins
-            if ($question = $this->try_importing_using_qtypes( $lines, $question, $answertext )) {
-                return $question;
-            }
             $giftqtypenotset = get_string('giftqtypenotset','quiz');
             $this->error( $giftqtypenotset, $text );
             return false;