From: gustav_delius Date: Sun, 9 Apr 2006 21:59:55 +0000 (+0000) Subject: Make sure all random questions have their parent field correctly set, just in case... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=955567ad2f7c51e92296652a0c4a756cc0b561d4;p=moodle.git Make sure all random questions have their parent field correctly set, just in case something went wrong here in the past. This may have been the cause of bug 5137 --- diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 52ccb51902..26d4e94f72 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -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; } diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 83e2cd3d50..f10417b800 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -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; } diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 21b4264c6c..764f48e1c2 100644 --- a/mod/quiz/version.php +++ b/mod/quiz/version.php @@ -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)?