]> git.mjollnir.org Git - moodle.git/commitdiff
In preparation of the qtype plugin-mechanism give set version information for all...
authorgustav_delius <gustav_delius>
Wed, 22 Mar 2006 08:41:56 +0000 (08:41 +0000)
committergustav_delius <gustav_delius>
Wed, 22 Mar 2006 08:41:56 +0000 (08:41 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/postgres7.php
mod/quiz/version.php

index 69a112f27955d98764c4b2fb2074ad2ba50d5e7b..8a2dece17722e2dc7e0a07e61b88fa780cf3e04c 100644 (file)
@@ -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;
 }
 
index dbc3abf80ca5bfe931f09f2fc930333ca7d63753..1752929e25a33e8cc0e5e3216d15305e69a9509e 100644 (file)
@@ -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;
 }
 
index 0d9be8ed15453de5013541bc15dcc02a4b4aefbd..322b5a03a06f4ad9cacdc871ee680e25b7a7c54a 100644 (file)
@@ -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)?