MDL-7913 Improved category detection (again) to extract all characters.
This commit is contained in:
@@ -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) == "::") {
|
||||
|
||||
Reference in New Issue
Block a user