From: tjhunt Date: Wed, 17 Sep 2008 05:24:29 +0000 (+0000) Subject: MDL-16505 - Removing qtype_datasetdependent questiontype - finish off the database... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=98e82289b3ea8b42e7911154349f0034de69c671;p=moodle.git MDL-16505 - Removing qtype_datasetdependent questiontype - finish off the database upgrade, after Pierre's previous work. --- diff --git a/mod/quiz/db/upgrade.php b/mod/quiz/db/upgrade.php index 0ee90aae78..1d5ede21df 100644 --- a/mod/quiz/db/upgrade.php +++ b/mod/quiz/db/upgrade.php @@ -192,7 +192,8 @@ function xmldb_quiz_upgrade($oldversion) { /// we need to say that these tables are already installed, otherwise XMLDB /// will try to create them again and give an error. if ($result && $oldversion < 2008082600) { - set_config('version', 2008082600, 'qtype_datasetdependent'); + // Since MDL-16505 was fixed, and we eliminated the datasetdependent + // question type, this is now a no-op. upgrade_mod_savepoint($result, 2008082600, 'quiz'); } diff --git a/question/type/calculated/db/install.xml b/question/type/calculated/db/install.xml index fec81addfd..2ff9edad0b 100644 --- a/question/type/calculated/db/install.xml +++ b/question/type/calculated/db/install.xml @@ -1,7 +1,7 @@ - +
@@ -19,5 +19,48 @@
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
-
+ \ No newline at end of file diff --git a/question/type/calculated/db/upgrade.php b/question/type/calculated/db/upgrade.php index 925230445f..78f3b2e206 100644 --- a/question/type/calculated/db/upgrade.php +++ b/question/type/calculated/db/upgrade.php @@ -26,13 +26,17 @@ function xmldb_qtype_calculated_upgrade($oldversion) { $dbman = $DB->get_manager(); $result = true; -/// And upgrade begins here. For each one, you'll need one -/// block of code similar to the next one. Please, delete -/// this comment lines once this file start handling proper -/// upgrade code. + // MDL-16505. + if ($result && $oldversion < 2008091700) { //New version in version.php + if (get_config('qtype_datasetdependent', 'version')) { + $result = $result && unset_config('version', 'qtype_datasetdependent'); + } + upgrade_plugin_savepoint($result, 2008091700, 'qtype', 'calculated'); + } /// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php /// $result = result of database_manager methods +/// upgrade_plugin_savepoint($result, YYYYMMDD00, 'qtype', 'calculated'); /// } return $result; diff --git a/question/type/calculated/version.php b/question/type/calculated/version.php index c39730578d..d576aac75a 100644 --- a/question/type/calculated/version.php +++ b/question/type/calculated/version.php @@ -1,6 +1,5 @@ version = 2006032200; +$plugin->version = 2008091700; $plugin->requires = 2007101000; - ?> diff --git a/question/type/datasetdependent/db/install.xml b/question/type/datasetdependent/db/install.xml deleted file mode 100644 index c24b425438..0000000000 --- a/question/type/datasetdependent/db/install.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
-
-
diff --git a/question/type/datasetdependent/db/upgrade.php b/question/type/datasetdependent/db/upgrade.php deleted file mode 100644 index b4675ceece..0000000000 --- a/question/type/datasetdependent/db/upgrade.php +++ /dev/null @@ -1,41 +0,0 @@ -get_manager(); - $result = true; - -/// And upgrade begins here. For each one, you'll need one -/// block of code similar to the next one. Please, delete -/// this comment lines once this file start handling proper -/// upgrade code. - -/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php -/// $result = result of database_manager methods -/// } - - return $result; -} - -?> diff --git a/question/type/datasetdependent/version.php b/question/type/datasetdependent/version.php deleted file mode 100644 index f15f65b36f..0000000000 --- a/question/type/datasetdependent/version.php +++ /dev/null @@ -1,6 +0,0 @@ -version = 2008082600; -$plugin->requires = 2007101000; - -?>