New field popup to control new feature: launch quiz in fullscreen popup window
authormoodler <moodler>
Tue, 14 Dec 2004 06:43:22 +0000 (06:43 +0000)
committermoodler <moodler>
Tue, 14 Dec 2004 06:43:22 +0000 (06:43 +0000)
mod/quiz/backuplib.php
mod/quiz/db/mysql.php
mod/quiz/db/mysql.sql
mod/quiz/db/postgres7.php
mod/quiz/db/postgres7.sql
mod/quiz/restorelib.php
mod/quiz/version.php

index ef181d58fdbca27ed475d2ea7a3cb2d3ba73cdfd..46c068587f485a8d7a5fb22b1bc94e843c8a0c95 100644 (file)
                 fwrite ($bf,full_tag("TIMELIMIT",4,false,$quiz->timelimit));
                 fwrite ($bf,full_tag("PASSWORD",4,false,$quiz->password));
                 fwrite ($bf,full_tag("SUBNET",4,false,$quiz->subnet));
+                fwrite ($bf,full_tag("POPUP",4,false,$quiz->popup));
                 //Now we print to xml question_grades (Course Level)
                 $status = backup_quiz_question_grades($bf,$preferences,$quiz->id);
                 //if we've selected to backup users info, then execute:
index f0bcbf3a49f793a3ef45108855950df1d2d01bc8..a3b15f8d9e11973c6a71010a71f52ed090d9a181 100644 (file)
@@ -292,6 +292,10 @@ function quiz_upgrade($oldversion) {
     if ($oldversion < 2004120501) {
         table_column("quiz_calculated", "", "correctanswerformat", "integer", "10", "", "2", "not null", "correctanswerlength");
     }
+
+    if ($oldversion < 2004121400) {  // New field to determine popup window behaviour
+        table_column("quiz", "", "popup", "integer", "4", "", "0", "not null", "subnet");
+    }
     
     return true;
 }
index 62ecb57d70f0caea9ec98ec5e2d350499b02526a..d881a43a722de0daf0cdd7fa50b7a9be66b42dd8 100644 (file)
@@ -36,6 +36,7 @@ CREATE TABLE `prefix_quiz` (
   `timelimit` int(2) unsigned NOT NULL default '0',
   `password` varchar(255) NOT NULL default '',
   `subnet` varchar(255) NOT NULL default '',
+  `popup` tinyint(4) NOT NULL default '0',
   PRIMARY KEY  (`id`),
   KEY `course` (`course`)
 ) TYPE=MyISAM COMMENT='Main information about each quiz';
index 89b61ed436ca62ee54a6aac5056255963523dcfa..2d290078cab50c10a2b3261dfd1042526e0ab48b 100644 (file)
@@ -278,6 +278,10 @@ function quiz_upgrade($oldversion) {
         table_column("quiz_calculated", "", "correctanswerformat", "integer", "10", "", "2", "not null", "correctanswerlength");
     }
 
+    if ($oldversion < 2004121400) {  // New field to determine popup window behaviour
+        table_column("quiz", "", "popup", "integer", "4", "", "0", "not null", "subnet");
+    }
+
     return true;
 }
 
index 5a5be530481f6e3e4d7ccdba06ee172f650a79b4..f788d5ad64f32f626ffe81a2e9b0e8526041a596 100644 (file)
@@ -35,7 +35,8 @@ CREATE TABLE prefix_quiz (
   timemodified integer NOT NULL default '0',
   timelimit integer NOT NULL default '0',
   password varchar(255) NOT NULL default '',
-  subnet varchar(255) NOT NULL default ''
+  subnet varchar(255) NOT NULL default '',
+  popup integer NOT NULL default '0'
 );
 
 CREATE INDEX prefix_quiz_course_idx ON prefix_quiz (course);
index d55a92a921500291adfbb79386cfa476e9898f74..6535318ae1f1153f8df71063e6c204223f62d277 100644 (file)
             $quiz->timelimit = backup_todb($info['MOD']['#']['TIMELIMIT']['0']['#']);
             $quiz->password = backup_todb($info['MOD']['#']['PASSWORD']['0']['#']);
             $quiz->subnet = backup_todb($info['MOD']['#']['SUBNET']['0']['#']);
+            $quiz->popup = backup_todb($info['MOD']['#']['POPUP']['0']['#']);
 
             //We have to recode the questions field (a list of questions id)          
             //Extracts question id from sequence
index c6f043845c7be931ac4be18de4ec28297d5c57ab..6535ddc3af894ee5a028855fbd6072031aad93c7 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004120501;   // The (date) version of this module
+$module->version  = 2004121400;   // The (date) version of this module
 $module->requires = 2004112300;   // Requires this Moodle version
 $module->cron     = 0;            // How often should cron check this module (seconds)?