mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merged from STABLE
This commit is contained in:
parent
86831b4c69
commit
d91ce7ce0a
3 changed files with 5 additions and 3 deletions
|
@ -28,10 +28,11 @@ class quiz_default_format {
|
||||||
|
|
||||||
/// Importing functions
|
/// Importing functions
|
||||||
|
|
||||||
function importpreprocess($category) {
|
function importpreprocess($category, $course=NULL ) {
|
||||||
/// Does any pre-processing that may be desired
|
/// Does any pre-processing that may be desired
|
||||||
|
|
||||||
$this->category = $category; // Important
|
$this->category = $category; // Important
|
||||||
|
$this->course = $course;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,10 @@ class quiz_format_multianswer extends quiz_default_format {
|
||||||
$thequestion= quiz_qtype_multianswer_extract_question
|
$thequestion= quiz_qtype_multianswer_extract_question
|
||||||
(addslashes(implode('',$lines)));
|
(addslashes(implode('',$lines)));
|
||||||
$thequestion->qtype = MULTIANSWER;
|
$thequestion->qtype = MULTIANSWER;
|
||||||
|
$thequestion->course = $this->course;
|
||||||
|
|
||||||
if (!empty($thequestion)) {
|
if (!empty($thequestion)) {
|
||||||
$thequestion->name = $lines[0];
|
$thequestion->name = addslashes($lines[0]);
|
||||||
|
|
||||||
$questions[] = $thequestion;
|
$questions[] = $thequestion;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
$classname = "quiz_format_$format";
|
$classname = "quiz_format_$format";
|
||||||
$quiz_format = new $classname();
|
$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!",
|
error("Error occurred during pre-processing!",
|
||||||
"$CFG->wwwroot/mod/quiz/import.php?category=$category->id");
|
"$CFG->wwwroot/mod/quiz/import.php?category=$category->id");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue