MDL-7913 Improved category detection (again) to extract all characters.

This commit is contained in:
thepurpleblob
2007-01-05 10:33:05 +00:00
parent 675c2419d1
commit 862dd9d01a
+5 -2
View File
@@ -141,14 +141,17 @@ class qformat_gift extends qformat_default {
$text = $this->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) == "::") {