From: thepurpleblob Date: Fri, 5 Jan 2007 10:35:13 +0000 (+0000) Subject: MDL-7913 Improved category detection (again) to extract all characters. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5363b5551b9146b35cac5e22f7c10d9573abf00c;p=moodle.git MDL-7913 Improved category detection (again) to extract all characters. --- diff --git a/question/format/gift/format.php b/question/format/gift/format.php index fc6e3fe266..ae0dfe46d6 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -1,5 +1,5 @@ + escapedchar_pre($text); // Look for category modifier - if (ereg( '^\$CATEGORY: *([A-Za-z0-9/]+)[[:space:]]', $text, $matches)) { - $newcategory = $matches[1]; + if (ereg( '^\$CATEGORY:', $text)) { + // $newcategory = $matches[1]; + $newcategory = trim(substr( $text, 10 )); // build fake question to contain category $question->qtype = 'category'; $question->category = $newcategory; return $question; } + + // QUESTION NAME parser if (substr($text, 0, 2) == "::") {