From: moodler Date: Mon, 16 Feb 2004 17:58:06 +0000 (+0000) Subject: Allow longer answers to support text fields better X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0e27a3ae71c97c01b811c590ad698acd3c261a59;p=moodle.git Allow longer answers to support text fields better --- diff --git a/mod/survey/db/mysql.php b/mod/survey/db/mysql.php index 8d940bc2ec..db34db9142 100644 --- a/mod/survey/db/mysql.php +++ b/mod/survey/db/mysql.php @@ -167,6 +167,11 @@ function survey_upgrade($oldversion) { execute_sql("INSERT INTO `{$CFG->prefix}survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (73, 'ciq5', 'ciq5short', '', '', 0, '')"); } + if ($oldversion < 2004021602) { + table_column("survey_answers", "answer1", "answer1", "text", "", "", ""); + table_column("survey_answers", "answer2", "answer2", "text", "", "", ""); + } + return true; } diff --git a/mod/survey/db/mysql.sql b/mod/survey/db/mysql.sql index 6ae60272ca..257c9b2e8a 100755 --- a/mod/survey/db/mysql.sql +++ b/mod/survey/db/mysql.sql @@ -68,8 +68,8 @@ CREATE TABLE prefix_survey_answers ( survey int(10) unsigned NOT NULL default '0', question int(10) unsigned NOT NULL default '0', time int(10) unsigned default NULL, - answer1 char(255) default NULL, - answer2 char(255) default NULL, + answer1 text default NULL, + answer2 text default NULL, PRIMARY KEY (id), UNIQUE KEY id (id) ) TYPE=MyISAM; diff --git a/mod/survey/db/postgres7.php b/mod/survey/db/postgres7.php index a9f302af0c..24f4f41a9f 100644 --- a/mod/survey/db/postgres7.php +++ b/mod/survey/db/postgres7.php @@ -15,6 +15,11 @@ function survey_upgrade($oldversion) { modify_database("", "INSERT INTO `prefix_survey_questions` (`id`, `text`, `shorttext`, `multi`, `intro`, `type`, `options`) VALUES (73, 'ciq5', 'ciq5short', '', '', 0, '')"); } + if ($oldversion < 2004021602) { + table_column("survey_answers", "answer1", "answer1", "text", "", "", ""); + table_column("survey_answers", "answer2", "answer2", "text", "", "", ""); + } + return true; } diff --git a/mod/survey/db/postgres7.sql b/mod/survey/db/postgres7.sql index 5a1a860704..7af7bc5cb7 100755 --- a/mod/survey/db/postgres7.sql +++ b/mod/survey/db/postgres7.sql @@ -65,8 +65,8 @@ CREATE TABLE prefix_survey_answers ( survey integer NOT NULL default '0', question integer NOT NULL default '0', time integer default NULL, - answer1 char(255) default NULL, - answer2 char(255) default NULL + answer1 text default NULL, + answer2 text default NULL ); # diff --git a/mod/survey/version.php b/mod/survey/version.php index 4686ffb0c9..daa60c1cf1 100644 --- a/mod/survey/version.php +++ b/mod/survey/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004021601; +$module->version = 2004021602; $module->requires = 2004013101; // Requires this Moodle version $module->cron = 0;