From: thepurpleblob Date: Wed, 29 Nov 2006 13:34:32 +0000 (+0000) Subject: Added ability to specify destination category within GIFT file. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b39c7aada6795e29aa4ee3ebada991eda74f236b;p=moodle.git Added ability to specify destination category within GIFT file. MDL-4163 --- diff --git a/question/format/gift/format.php b/question/format/gift/format.php index f70574e924..c48b6d4bb9 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -142,6 +142,16 @@ class qformat_gift extends qformat_default { // Substitute escaped control characters with placeholders $text = $this->escapedchar_pre($text); + // Look for category modifier + if (ereg( '^\$CATEGORY:(.+)', $text, $matches)) { + $newcategory = $matches[1]; + + // build fake question to contain category + $question->qtype = 'category'; + $question->category = $newcategory; + return $question; + } + // QUESTION NAME parser if (substr($text, 0, 2) == "::") { $text = substr($text, 2);