From 3be86ca6b365514615b482ce9c91986e9abf70d1 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 22 Mar 2006 08:41:56 +0000 Subject: [PATCH] In preparation of the qtype plugin-mechanism give set version information for all questiontypes that already have database tables. --- mod/quiz/db/mysql.php | 15 +++++++++++++++ mod/quiz/db/postgres7.php | 15 +++++++++++++++ mod/quiz/version.php | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 69a112f279..8a2dece177 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -973,6 +973,7 @@ function quiz_upgrade($oldversion) { } if ($oldversion < 2006032100) { + // change from the old questiontype numbers to using the questiontype names table_column('question', 'qtype', 'qtype', 'varchar', 20, '', '', 'not null'); set_field('question', 'qtype', 'shortanswer', 'qtype', 1); set_field('question', 'qtype', 'truefalse', 'qtype', 2); @@ -988,6 +989,20 @@ function quiz_upgrade($oldversion) { set_field('question', 'qtype', 'essay', 'qtype', 12); } + if ($oldversion < 2006032200) { + // set version for all questiontypes that already have their tables installed + set_config('qtype_calculated_version', 2006032100); + set_config('qtype_essay_version', 2006032100); + set_config('qtype_match_version', 2006032100); + set_config('qtype_multianswer_version', 2006032100); + set_config('qtype_multichoice_version', 2006032100); + set_config('qtype_numerical_version', 2006032100); + set_config('qtype_randomsamatch_version', 2006032100); + set_config('qtype_rqp_version', 2006032100); + set_config('qtype_shortanswer_version', 2006032100); + set_config('qtype_truefalse_version', 2006032100); + } + return true; } diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index dbc3abf80c..1752929e25 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -1142,6 +1142,7 @@ function quiz_upgrade($oldversion) { } if ($oldversion < 2006032100) { + // change from the old questiontype numbers to using the questiontype names table_column('question', 'qtype', 'qtype', 'varchar', 20, '', '', 'not null'); set_field('question', 'qtype', 'shortanswer', 'qtype', 1); set_field('question', 'qtype', 'truefalse', 'qtype', 2); @@ -1157,6 +1158,20 @@ function quiz_upgrade($oldversion) { set_field('question', 'qtype', 'essay', 'qtype', 12); } + if ($oldversion < 2006032200) { + // set version for all questiontypes that already have their tables installed + set_config('qtype_calculated_version', 2006032100); + set_config('qtype_essay_version', 2006032100); + set_config('qtype_match_version', 2006032100); + set_config('qtype_multianswer_version', 2006032100); + set_config('qtype_multichoice_version', 2006032100); + set_config('qtype_numerical_version', 2006032100); + set_config('qtype_randomsamatch_version', 2006032100); + set_config('qtype_rqp_version', 2006032100); + set_config('qtype_shortanswer_version', 2006032100); + set_config('qtype_truefalse_version', 2006032100); + } + return true; } diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 0d9be8ed15..322b5a03a0 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 = 2006032100; // The (date) version of this module +$module->version = 2006032200; // The (date) version of this module $module->requires = 2006022400; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)? -- 2.39.5