moodle/mod/quiz/db/postgres7.php
2003-02-24 10:42:07 +00:00

31 lines
1.1 KiB
PHP

<?PHP // $Id$
function quiz_upgrade($oldversion) {
// This function does anything necessary to upgrade
// older versions to match current functionality
global $CFG;
if ($oldversion < 2003010100) {
execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD review integer DEFAULT '0' NOT NULL AFTER `grademethod` ");
}
if ($oldversion < 2003010301) {
table_column("quiz_truefalse", "true", "trueanswer", "INTEGER", "10", "UNSIGNED", "0", "NOT NULL", "");
table_column("quiz_truefalse", "false", "falseanswer", "INTEGER", "10", "UNSIGNED", "0", "NOT NULL", "");
table_column("quiz_questions", "type", "qtype", "INTEGER", "10", "UNSIGNED", "0", "NOT NULL", "");
}
if ($oldversion < 2003022303) {
modify_database ("", "CREATE TABLE prefix_quiz_randommatch (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
choose integer NOT NULL default '4',
);");
}
return true;
}
?>