From: moodler Date: Sun, 17 Oct 2004 04:08:32 +0000 (+0000) Subject: Enlarge answer field to TEXT (see http://moodle.org/mod/forum/discuss.php?d=10333) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=193ba8e7c4dab8bc6e89f13a2dc714a5075a2689;p=moodle.git Enlarge answer field to TEXT (see http://moodle.org/mod/forum/discuss.php?d=10333) --- diff --git a/mod/quiz/db/mysql.php b/mod/quiz/db/mysql.php index 91b6ce97d1..499097a8d1 100644 --- a/mod/quiz/db/mysql.php +++ b/mod/quiz/db/mysql.php @@ -266,6 +266,10 @@ function quiz_upgrade($oldversion) { KEY `question` (`question`) ) TYPE=MyISAM COMMENT='Options for questions of type calculated'; "); } + + if ($oldversion < 2004101700) { + table_column("quiz_answers", "answer", "answer", "text", "", "", "", "not null"); + } return true; } diff --git a/mod/quiz/db/mysql.sql b/mod/quiz/db/mysql.sql index 136b6be245..43017a15ec 100644 --- a/mod/quiz/db/mysql.sql +++ b/mod/quiz/db/mysql.sql @@ -47,7 +47,7 @@ CREATE TABLE `prefix_quiz` ( CREATE TABLE `prefix_quiz_answers` ( `id` int(10) unsigned NOT NULL auto_increment, `question` int(10) unsigned NOT NULL default '0', - `answer` varchar(255) NOT NULL default '', + `answer` text NOT NULL default '', `fraction` varchar(10) NOT NULL default '0.0', `feedback` text NOT NULL, PRIMARY KEY (`id`), diff --git a/mod/quiz/db/postgres7.php b/mod/quiz/db/postgres7.php index f2ae99cc1b..dba8d9e742 100644 --- a/mod/quiz/db/postgres7.php +++ b/mod/quiz/db/postgres7.php @@ -224,6 +224,10 @@ function quiz_upgrade($oldversion) { modify_database ( "", "COMMIT;"); } + + if ($oldversion < 2004101700) { + table_column("quiz_answers", "answer", "answer", "text", "", "", "", "not null"); + } return true; } diff --git a/mod/quiz/db/postgres7.sql b/mod/quiz/db/postgres7.sql index d19dae6e37..63c15cb1ab 100644 --- a/mod/quiz/db/postgres7.sql +++ b/mod/quiz/db/postgres7.sql @@ -46,7 +46,7 @@ CREATE TABLE prefix_quiz ( CREATE TABLE prefix_quiz_answers ( id SERIAL PRIMARY KEY, question integer NOT NULL default '0', - answer varchar(255) NOT NULL default '', + answer text NOT NULL default '', fraction varchar(10) NOT NULL default '0.0', feedback text NOT NULL default '' ); diff --git a/mod/quiz/version.php b/mod/quiz/version.php index 57b9be135a..59a29d3042 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 = 2004091700; // The (date) version of this module +$module->version = 2004101700; // The (date) version of this module $module->requires = 2004091700; // Requires this Moodle version $module->cron = 0; // How often should cron check this module (seconds)?