3 // THIS FILE IS DEPRECATED! PLEASE DO NOT MAKE CHANGES TO IT!
5 // IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL
6 // LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
8 function hotpot_upgrade($oldversion) {
12 // set path to update functions
13 $update_to_v2 = "$CFG->dirroot/mod/hotpot/db/update_to_v2.php";
15 // if the version number indicates this could be an early HotPot v2.1 (Moodle 1.6),
16 // check this is not actually HotPot v1 or v2.0 (Moodle 1.5) with an overly advanced version number
17 if ($oldversion>2005031400 && $oldversion<=2006082899) {
18 require_once $update_to_v2;
19 if (hotpot_db_table_exists('hotpot_attempts')) {
20 if (hotpot_db_field_exists('hotpot_attempts', 'details')) {
21 // HotPot v2.0 (Moodle 1.5)
22 $oldversion = 2005031400;
26 $oldversion = 2004122000;
30 if ($oldversion < 2004021400) {
31 execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
32 execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
35 // update from HotPot v1 to HotPot v2
36 if ($oldversion < 2005031400) {
37 require_once $update_to_v2;
38 $ok = $ok && hotpot_update_to_v2_from_v1();
40 if ($oldversion < 2005090700) {
41 require_once $update_to_v2;
42 $ok = $ok && hotpot_update_to_v2_1();
44 if ($oldversion > 2005031419 && $oldversion < 2005090702) {
45 // update to from HotPot v2.1.0 or v2.1.1
46 require_once $update_to_v2;
47 $ok = $ok && hotpot_update_to_v2_1_2();
49 if ($oldversion < 2006042103) {
50 require_once $update_to_v2;
51 $ok = $ok && hotpot_update_to_v2_1_16();
53 if ($oldversion < 2006042601) {
54 require_once $update_to_v2;
55 $ok = $ok && hotpot_update_to_v2_1_17();
57 if ($oldversion < 2006042803) {
58 require_once $update_to_v2;
59 $ok = $ok && hotpot_update_to_v2_1_18();
61 if ($oldversion < 2006083101) {
62 require_once $update_to_v2;
63 $ok = $ok && hotpot_update_to_v2_2();
66 ////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.