diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 5fcdf263708..1db3ac72848 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -890,6 +890,11 @@ function quiz_upgrade($oldversion) { table_column('quiz_randomsamatch', '', 'shuffleanswers', 'tinyint', '4', 'unsigned', '1', 'not null', 'choose'); } + if ($oldversion < 2006021104) { + // add originalversion field for the new versioning mechanism + table_column('quiz_question_versions', '', 'originalquestion', 'int', '10', 'unsigned', '0', 'not null', 'newquestion'); + } + return true; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index 2dbd35bab64..7d8e01c3992 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -368,6 +368,7 @@ CREATE TABLE prefix_quiz_question_versions ( quiz int(10) unsigned NOT NULL default '0', oldquestion int(10) unsigned NOT NULL default '0', newquestion int(10) unsigned NOT NULL default '0', + originalquestion int(10) unsigned NOT NULL default '0', userid int(10) unsigned NOT NULL default '0', timestamp int(10) unsigned NOT NULL default '0', PRIMARY KEY (id) diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index 4463bc6be50..c3428b9c7f8 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -986,6 +986,11 @@ function quiz_upgrade($oldversion) { table_column('quiz_randomsamatch', '', 'shuffleanswers', 'tinyint', '4', 'unsigned', '1', 'not null', 'choose'); } + if ($oldversion < 2006021104) { + // add originalversion field for the new versioning mechanism + table_column('quiz_question_versions', '', 'originalquestion', 'int', '10', 'unsigned', '0', 'not null', 'newquestion'); + } + return true; } diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql index 9dd8b60707b..837959e0504 100644 --- a/mod/quiz/db/postgres7.sql +++ b/mod/quiz/db/postgres7.sql @@ -334,6 +334,7 @@ CREATE TABLE prefix_quiz_question_versions ( quiz integer NOT NULL default '0', oldquestion integer NOT NULL default '0', newquestion integer NOT NULL default '0', + originalquestion integer NOT NULL default '0', userid integer NOT NULL default '0', timestamp integer NOT NULL default '0' ); diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 792070887a2..d701d3e85b3 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 = 2006021103; // The (date) version of this module +$module->version = 2006021104; // The (date) version of this module $module->requires = 2005021600; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)?