Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

when updating, if the version number indicates this could be an early…

… HotPot v2.1 (Moodle 1.6) then check this is not HotPot v2.0 (Moodle 1.5) with an overly advanced version number. Also, added backwards compatability back to Moodle 1.1.1 New release is HotPot v2.1.23, version is 2006082900
  • Loading branch information...
commit 22c633e8b7c4b623e73b2e37e6a23780069e01c5 1 parent 664f806
gbateson authored
View
2  mod/hotpot/README.TXT
@@ -1,5 +1,5 @@
===============================================
-This is v2.1.22 of the HotPot module for Moodle
+This is v2.1.23 of the HotPot module for Moodle
===============================================
This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle.
View
19 mod/hotpot/db/mysql.php
@@ -1,8 +1,25 @@
<?PHP
function hotpot_upgrade($oldversion) {
- global $CFG;
+ global $db, $CFG;
$ok = true;
+ // some versions of HotPot v2.0 were advanced past the beginning of the start of HotPot v2.1
+
+ // if the version number indicates this could be an early HotPot v2.1 (Moodle 1.6),
+ // check this is not actually HotPot v2.0 (Moodle 1.5) with an overly advanced version number
+ if ($oldversion>2005031400 && $oldversion<=2006082899) {
+ $columns = $db->MetaColumns($CFG->prefix.'hotpot_attempts');
+ foreach ($columns as $column) {
+ if ($column->name=='details') {
+ // the "hotpot_attempts" table has a "details" field so this is actually HotPot v2.0
+ // reset the version number in order to trigger the correct order of updates
+ print "HotPot v2.0 detected<br>";
+ $oldversion = 2005031400;
+ break;
+ }
+ }
+ }
+
if ($oldversion < 2004021400) {
execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
View
14 mod/hotpot/db/postgres7.php
@@ -3,6 +3,20 @@ function hotpot_upgrade($oldversion) {
global $CFG;
$ok = true;
+ // if the version number indicates this could be an early HotPot v2.1 (Moodle 1.6),
+ // check this is not actually HotPot v2.0 (Moodle 1.5) with an overly advanced version number
+ if ($oldversion>2005031400 && $oldversion<=2006082899) {
+ $columns = $db->MetaColumns($CFG->prefix.'hotpot_attempts');
+ foreach ($columns as $column) {
+ if ($column->name=='details') {
+ // the "hotpot_attempts" table has a "details" field so this is actually HotPot v2.0
+ // reset the version number in order to trigger the correct order of updates
+ $oldversion = 2005031400;
+ break;
+ }
+ }
+ }
+
// set path to update functions
$update_to_v2 = "$CFG->dirroot/mod/hotpot/db/update_to_v2.php";
View
6 mod/hotpot/version.php
@@ -3,9 +3,9 @@
/// Code fragment to define the version of hotpot
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006080701; // change only last two digits in 1.6.x!!
-$module->release = 'v2.1.22'; // human-friendly version name (used in mod/hotpot/lib.php)
-$module->requires = 2006050512; // replace with 2005060241 if you want to use it with latest 1.5.4+
+$module->version = 2006082900; // change only last two digits in 1.6.x!!
+$module->release = 'v2.1.23'; // human-friendly version name (used in mod/hotpot/lib.php)
+$module->requires = 2003091111; // replace with 2005060241 if you want to use it with latest 1.5.4+
$module->cron = 0; // period for cron to check this module (secs)
// interpretation of YYYYMMDDXY version numbers
// YYYY : year
Please sign in to comment.
Something went wrong with that request. Please try again.