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

This commit is contained in:
gustav_delius 2006-04-09 21:59:55 +00:00
parent 7a0b035bf9
commit 955567ad2f
3 changed files with 9 additions and 1 deletions

View 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;
}

View 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;
}

View 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)?