return $qo;
}
+ /**
+ * this is not a real question type. It's a dummy type used
+ * to specify the import category
+ * format is:
+ * <question type="category">
+ * <category>tom/dick/harry</category>
+ * </question>
+ */
+ function import_category( $question ) {
+ $qo->qtype = 'category';
+ $qo->category = $question['#']['category'][0]['#'];
+ return $qo;
+ }
+
/**
* parse the array of lines into an array of questions
* this *could* burn memory - but it won't happen that much
elseif ($question_type=='essay') {
$qo = $this->import_essay( $question );
}
+ elseif ($question_type=='category') {
+ $qo = $this->import_category( $question );
+ }
else {
$notsupported = get_string( 'xmltypeunsupported','quiz',$question_type );
echo "<p>$notsupported</p>";
$questions[] = $qo;
}
}
-
return $questions;
}