From b39c7aada6795e29aa4ee3ebada991eda74f236b Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Wed, 29 Nov 2006 13:34:32 +0000 Subject: [PATCH] Added ability to specify destination category within GIFT file. MDL-4163 --- question/format/gift/format.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- 2.39.5