From 5363b5551b9146b35cac5e22f7c10d9573abf00c Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Fri, 5 Jan 2007 10:35:13 +0000 Subject: [PATCH] MDL-7913 Improved category detection (again) to extract all characters. --- question/format/gift/format.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) == "::") { -- 2.39.5