Permalink
Browse files

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

…ssing due to data error in mbz file.
  • Loading branch information...
1 parent d71b79a commit 4b92f65351d96b123e07cf8a29dd653674f996d4 @nebgor nebgor committed Jun 21, 2012
@@ -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

0 comments on commit 4b92f65

Please sign in to comment.