]> git.mjollnir.org Git - moodle.git/commitdiff
Added new fields for quiz password and subnet restrictions
authormoodler <moodler>
Wed, 7 Jul 2004 07:47:33 +0000 (07:47 +0000)
committermoodler <moodler>
Wed, 7 Jul 2004 07:47:33 +0000 (07:47 +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 380f97b8ca676ac71f8991a6bebad4cd7ab4228f..6a919c9c1bef6f05f64f656fcacdc8d9e4e90e83 100644 (file)
@@ -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;
 }
 
index 14475cc4551f0cbe54ca1527122ba21acf1772f1..4ca74fa8808160b69e2f88cf3e52efab9c54a628 100644 (file)
@@ -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';
 # --------------------------------------------------------
index c9a179c72056ab8865262e21cd390314f3fc787b..108952a76eb703ff15a36a5ef80f7566e6109029 100644 (file)
@@ -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;
 }
 
index 1c60d050e7fea923290b41c60c4d17516b400c8f..4b47b12c28c5b56c9a1001f6f31d978d2f5bbacf 100644 (file)
@@ -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 ''
 );
 # --------------------------------------------------------
 
index 4521962883031416d0be17045f04b36af4cbfc77..2a97790aa65df2aa02da6aa926a40c36ebb32f96 100644 (file)
@@ -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)?