Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d302ba2
)
MDL-49880 mod_lesson: Fixed notice while importing questions.
author
Adrian Greeve
<adrian@moodle.com>
Fri, 17 Apr 2015 03:30:18 +0000
(11:30 +0800)
committer
Adrian Greeve
<adrian@moodle.com>
Mon, 20 Apr 2015 01:12:20 +0000
(09:12 +0800)
Cloze questions (not supported by lesson) threw up a notice saying that
the course wasn't set.
question/format/xml/format.php
patch
|
blob
|
blame
|
history
diff --git
a/question/format/xml/format.php
b/question/format/xml/format.php
index
d854ce4
..
4ddff96
100644
(file)
--- a/
question/format/xml/format.php
+++ b/
question/format/xml/format.php
@@
-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'];