From 9dd460390cd1414d35fe42f0b9c4397424da3be9 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 15 Nov 2010 15:27:24 +0000 Subject: [PATCH] question import MDL-25200 was ignoring the category specified in the file. --- question/format.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/question/format.php b/question/format.php index ee72b6159f4..8c6c761eaad 100644 --- a/question/format.php +++ b/question/format.php @@ -252,11 +252,11 @@ class qformat_default { $context = $category->context; $this->importcontext = $context; - // reset the timer in case file upload was slow - set_time_limit(0); + // reset the timer in case file upload was slow + set_time_limit(0); - // STAGE 1: Parse the file - echo $OUTPUT->notification(get_string('parsingquestions','quiz')); + // STAGE 1: Parse the file + echo $OUTPUT->notification(get_string('parsingquestions','quiz')); if (! $lines = $this->readdata($this->filename)) { echo $OUTPUT->notification(get_string('cannotread','quiz')); @@ -326,7 +326,7 @@ class qformat_default { @set_time_limit(0); // check for category modifiers - if ($question->qtype=='category') { + if ($question->qtype == 'category') { if ($this->catfromfile) { // find/create category object $catpath = $question->category; @@ -343,7 +343,7 @@ class qformat_default { echo "

$count. ".$this->format_question_text($question)."

"; - $question->category = $category->id; + $question->category = $this->category->id; $question->stamp = make_unique_id_code(); // Set the unique code (not to be changed) $question->createdby = $USER->id; -- 2.43.0