mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Merged from STABLE
This commit is contained in:
parent
86831b4c69
commit
d91ce7ce0a
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user