MDL-49880 mod_lesson: Fixed notice while importing questions.

Cloze questions (not supported by lesson) threw up a notice saying that
the course wasn't set.
This commit is contained in:
Adrian Greeve
2015-04-20 08:43:46 +08:00
parent 99a5af9eda
commit fd6358feaa
+5 -1
View File
@@ -454,7 +454,11 @@ class qformat_xml extends qformat_default {
// Header parts particular to multianswer.
$qo->qtype = 'multianswer';
$qo->course = $this->course;
// Only set the course if the data is available.
if (isset($this->course)) {
$qo->course = $this->course;
}
$qo->name = $this->clean_question_name($this->import_text($question['#']['name'][0]['#']['text']));
$qo->questiontextformat = $questiontext['format'];