]> git.mjollnir.org Git - moodle.git/commitdiff
Make sure all random questions have their parent field correctly set, just in case...
authorgustav_delius <gustav_delius>
Sun, 9 Apr 2006 21:59:55 +0000 (21:59 +0000)
committergustav_delius <gustav_delius>
Sun, 9 Apr 2006 21:59:55 +0000 (21:59 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php
mod/quiz/version.php

index 52ccb519023f09812e0b03461975222797745dc3..26d4e94f725ffcb60a6980ef50ee53ca07136541 100644 (file)
@@ -1007,6 +1007,10 @@ function quiz_upgrade($oldversion) {
         table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
     }
 
+    if ($oldversion < 2006040900) {
+        modify_database('', "UPDATE prefix_question SET parent = id WHERE qtype ='random';");
+    }
+
     return true;
 }
 
index 83e2cd3d5001a407e3d06f6340769f589cb6dc3a..f10417b800159b1b95602f79e241bebfbdb403fc 100644 (file)
@@ -1176,6 +1176,10 @@ function quiz_upgrade($oldversion) {
         table_column('question_sessions', '', 'comment', 'text', '', '', '', 'not null', 'sumpenalty');
     }
 
+    if ($oldversion < 2006040900) {
+        modify_database('', "UPDATE prefix_question SET parent = id WHERE qtype ='random';");
+    }
+
     return true;
 }
 
index 21b4264c6cb13eb7a3235c3992987b02063eaf02..764f48e1c26d04eafe194306761511b9d13b278c 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2006040600;   // The (date) version of this module
+$module->version  = 2006040900;   // The (date) version of this module
 $module->requires = 2006022400;   // Requires this Moodle version
 $module->cron     = 0;            // How often should cron check this module (seconds)?