Added ability to specify destination category within GIFT file.

MDL-4163
This commit is contained in:
thepurpleblob
2006-11-29 13:34:32 +00:00
parent 08892d5be5
commit b39c7aada6
+10
View File
@@ -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);