From f38065ff421e32b6c1a19b4499b5e14a72f16cc7 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 11 Jan 2012 17:36:30 +0000 Subject: [PATCH] MDL-31058 qtype match 1.9 restore: fix restore of dodgy questions. --- question/type/match/backup/moodle1/lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/question/type/match/backup/moodle1/lib.php b/question/type/match/backup/moodle1/lib.php index 08afe9a6b75..94ba8277ce7 100644 --- a/question/type/match/backup/moodle1/lib.php +++ b/question/type/match/backup/moodle1/lib.php @@ -56,7 +56,11 @@ class moodle1_qtype_match_handler extends moodle1_qtype_handler { } // convert match options - $matchoptions = $data['matchoptions'][0]; + if (isset($data['matchoptions'])) { + $matchoptions = $data['matchoptions'][0]; + } else { + $matchoptions = array('shuffleanswers' => 1); + } $matchoptions['id'] = $this->converter->get_nextid(); $matchoptions['subquestions'] = implode(',', $matchids); $this->write_xml('matchoptions', $matchoptions, array('/matchoptions/id'));