Merge branch 'MDL-35987-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Andrew Nicols
2016-05-30 13:38:52 +08:00
@@ -102,7 +102,11 @@ class restore_qtype_multianswer_plugin extends restore_qtype_plugin {
AND bi.itemname = 'question_created'",
array($this->get_restoreid()));
foreach ($rs as $rec) {
$sequencearr = explode(',', $rec->sequence);
$sequencearr = preg_split('/,/', $rec->sequence, -1, PREG_SPLIT_NO_EMPTY);
if (substr_count($rec->sequence, ',') + 1 != count($sequencearr)) {
$this->task->log('Invalid sequence found in restored multianswer question ' . $rec->id, backup::LOG_WARNING);
}
foreach ($sequencearr as $key => $question) {
$sequencearr[$key] = $this->get_mappingid('question', $question);
}