MDL-29270 Fixed question bank backup converter (field rename)
authorJean-Michel Vedrine <vedrine@vedrine.org>
Sun, 25 Sep 2011 21:30:40 +0000 (23:30 +0200)
committerDavid Mudrak <david@moodle.com>
Sun, 25 Sep 2011 21:33:00 +0000 (23:33 +0200)
backup/converter/moodle1/handlerlib.php

index 1b38074..849a4af 100644 (file)
@@ -1222,11 +1222,14 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
         }
         unset($data['image']);
 
+        // replay the upgrade step 2011060301 - Rename field defaultgrade on table question to defaultmark
+        $data['defaultmark'] = $data['defaultgrade'];
+
         // write the common question data
         $this->xmlwriter->begin_tag('question', array('id' => $data['id']));
         foreach (array(
             'parent', 'name', 'questiontext', 'questiontextformat',
-            'generalfeedback', 'generalfeedbackformat', 'defaultgrade',
+            'generalfeedback', 'generalfeedbackformat', 'defaultmark',
             'penalty', 'qtype', 'length', 'stamp', 'version', 'hidden',
             'timecreated', 'timemodified', 'createdby', 'modifiedby'
         ) as $fieldname) {