From: moodler Date: Wed, 7 Jul 2004 07:47:33 +0000 (+0000) Subject: Added new fields for quiz password and subnet restrictions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=88c898f590b12bbb6bcff1c7e482669e17ab5115;p=moodle.git Added new fields for quiz password and subnet restrictions --- diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 380f97b8ca..6a919c9c1b 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -199,6 +199,11 @@ function quiz_upgrade($oldversion) { execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD timelimit INT(2) UNSIGNED DEFAULT '0' NOT NULL "); } + if ($oldversion < 2004070700) { + table_column("quiz", "", "password", "varchar", "255", "", "", "not null", ""); + table_column("quiz", "", "subnet", "varchar", "255", "", "", "not null", ""); + } + return true; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index 14475cc455..4ca74fa880 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -34,6 +34,8 @@ CREATE TABLE `prefix_quiz` ( `timecreated` int(10) unsigned NOT NULL default '0', `timemodified` int(10) unsigned NOT NULL default '0', `timelimit` int(2) unsigned NOT NULL default '0', + `password` varchar(255) NOT NULL default '', + `subnet` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM COMMENT='Main information about each quiz'; # -------------------------------------------------------- diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index c9a179c720..108952a76e 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -153,6 +153,11 @@ function quiz_upgrade($oldversion) { execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD timelimit integer DEFAULT '0' NOT NULL "); } + if ($oldversion < 2004070700) { + table_column("quiz", "", "password", "varchar", "255", "", "", "not null", ""); + table_column("quiz", "", "subnet", "varchar", "255", "", "", "not null", ""); + } + return true; } diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql index 1c60d050e7..4b47b12c28 100644 --- a/mod/quiz/db/postgres7.sql +++ b/mod/quiz/db/postgres7.sql @@ -33,7 +33,9 @@ CREATE TABLE prefix_quiz ( grade integer NOT NULL default '0', timecreated integer NOT NULL default '0', timemodified integer NOT NULL default '0', - timelimit integer NOT NULL default '0' + timelimit integer NOT NULL default '0', + password varchar(255) NOT NULL default '', + subnet varchar(255) NOT NULL default '' ); # -------------------------------------------------------- diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 4521962883..2a97790aa6 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 = 2004060400; // The (date) version of this module +$module->version = 2004070700; // The (date) version of this module $module->requires = 2004060200; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)?