Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

MDL-26587 Question : fixed restoring shortanswer where answers are mi…

…ssing due to data error in mbz file.
  • Loading branch information...
commit 5f3d7b1949af3cf29669b8c77229077c262a9228 1 parent 4923e18
@nebgor nebgor authored danpoltawski committed
4 question/type/shortanswer/backup/moodle2/restore_qtype_shortanswer_plugin.class.php
@@ -68,8 +68,8 @@ public function process_shortanswer($data) {
$questioncreated = $this->get_mappingid('question_created', $oldquestionid) ? true : false;
// If the question has been created by restore, we need to create its
- // question_shortanswer too
- if ($questioncreated) {
+ // question_shortanswer too, if they are defined (the gui should ensure this).
+ if ($questioncreated && !empty($data->answers)) {
// Adjust some columns
$data->question = $newquestionid;
// Map sequence of question_answer ids
Please sign in to comment.
Something went wrong with that request. Please try again.