From: moodler Date: Thu, 1 Jul 2004 07:01:26 +0000 (+0000) Subject: Added two fields for time restrictions on choices X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b9080b73c78e3370efb1a0fbc120f75374e054bd;p=moodle.git Added two fields for time restrictions on choices --- diff --git a/mod/choice/db/mysql.php b/mod/choice/db/mysql.php index f3313ed5fa..bfb55165ce 100644 --- a/mod/choice/db/mysql.php +++ b/mod/choice/db/mysql.php @@ -29,6 +29,11 @@ function choice_upgrade($oldversion) { modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name');"); modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name');"); } + if ($oldversion < 2004070100) { + table_column("choice", "", "timeclose", "integer", "10", "unsigned", "0", "", "showunanswered"); + table_column("choice", "", "timeopen", "integer", "10", "unsigned", "0", "", "showunanswered"); + } + return true; } diff --git a/mod/choice/db/mysql.sql b/mod/choice/db/mysql.sql index c43cd39974..a96a6f4547 100755 --- a/mod/choice/db/mysql.sql +++ b/mod/choice/db/mysql.sql @@ -28,6 +28,8 @@ CREATE TABLE prefix_choice ( answer6 varchar(255) default NULL, publish tinyint(2) unsigned NOT NULL default '0', showunanswered tinyint(2) unsigned NOT NULL default '0', + timeopen int(10) unsigned NOT NULL default '0', + timeclose int(10) unsigned NOT NULL default '0', timemodified int(10) unsigned NOT NULL default '0', PRIMARY KEY (id), UNIQUE KEY id (id) diff --git a/mod/choice/db/postgres7.php b/mod/choice/db/postgres7.php index 04fc87a8d3..d5911bd5f7 100644 --- a/mod/choice/db/postgres7.php +++ b/mod/choice/db/postgres7.php @@ -15,6 +15,10 @@ function choice_upgrade($oldversion) { modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose', 'choice', 'name');"); modify_database("", "INSERT INTO prefix_log_display VALUES ('choice', 'choose again', 'choice', 'name');"); } + if ($oldversion < 2004070100) { + table_column("choice", "", "timeclose", "integer", "10", "unsigned", "0", "", "showunanswered"); + table_column("choice", "", "timeopen", "integer", "10", "unsigned", "0", "", "showunanswered"); + } return true; } diff --git a/mod/choice/db/postgres7.sql b/mod/choice/db/postgres7.sql index ec08c37e38..4e107bafee 100755 --- a/mod/choice/db/postgres7.sql +++ b/mod/choice/db/postgres7.sql @@ -28,6 +28,8 @@ CREATE TABLE prefix_choice ( answer6 varchar(255) default NULL, showunanswered integer NOT NULL default '0', publish integer NOT NULL default '0', + timeopen integer NOT NULL default '0', + timeclose integer NOT NULL default '0', timemodified integer NOT NULL default '0' ); diff --git a/mod/choice/version.php b/mod/choice/version.php index f9049c7880..2d5a7710e1 100644 --- a/mod/choice/version.php +++ b/mod/choice/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004060400; +$module->version = 2004070100; $module->requires = 2004052501; // Requires this Moodle version $module->cron = 0;