Merged from STABLE

This commit is contained in:
thepurpleblob 2005-08-26 11:59:59 +00:00
parent 86831b4c69
commit d91ce7ce0a
3 changed files with 5 additions and 3 deletions

View File

@ -28,10 +28,11 @@ class quiz_default_format {
/// Importing functions
function importpreprocess($category) {
function importpreprocess($category, $course=NULL ) {
/// Does any pre-processing that may be desired
$this->category = $category; // Important
$this->course = $course;
return true;
}

View File

@ -25,9 +25,10 @@ class quiz_format_multianswer extends quiz_default_format {
$thequestion= quiz_qtype_multianswer_extract_question
(addslashes(implode('',$lines)));
$thequestion->qtype = MULTIANSWER;
$thequestion->course = $this->course;
if (!empty($thequestion)) {
$thequestion->name = $lines[0];
$thequestion->name = addslashes($lines[0]);
$questions[] = $thequestion;
}

View File

@ -60,7 +60,7 @@
$classname = "quiz_format_$format";
$quiz_format = new $classname();
if (! $quiz_format->importpreprocess($category)) { // Do anything before that we need to
if (! $format->importpreprocess($category,$course)) { // Do anything before that we need to
error("Error occurred during pre-processing!",
"$CFG->wwwroot/mod/quiz/import.php?category=$category->id");
}