]> git.mjollnir.org Git - moodle.git/commitdiff
Enlarge answer field to TEXT (see http://moodle.org/mod/forum/discuss.php?d=10333)
authormoodler <moodler>
Sun, 17 Oct 2004 04:08:32 +0000 (04:08 +0000)
committermoodler <moodler>
Sun, 17 Oct 2004 04:08:32 +0000 (04:08 +0000)
mod/quiz/db/mysql.php
mod/quiz/db/mysql.sql
mod/quiz/db/postgres7.php
mod/quiz/db/postgres7.sql
mod/quiz/version.php

index 91b6ce97d126192572fe54a597942dff540d8488..499097a8d19df870dc77f90b45613f1ec74dbd84 100644 (file)
@@ -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;
 }
index 136b6be245fbdde129ed1852dc221cb4500a3170..43017a15ecbacb13f9a24be645cee1cb6fa691a6 100644 (file)
@@ -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`),
index f2ae99cc1b6b68c275bebd6ac2c3bcc597a7786a..dba8d9e7423e36a3788e0a0a62c99fc22437bd09 100644 (file)
@@ -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;
 }
index d19dae6e379dea659787d2909161ae730359652f..63c15cb1ab6c377351f9aa78f6acd526a02c91c2 100644 (file)
@@ -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 ''
 );
index 57b9be135ab247607c08f632192500aabd10519a..59a29d30426104432233a5e7ccb733011ae3a62c 100644 (file)
@@ -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)?