Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
New field popup to control new feature: launch quiz in fullscreen pop…
…up window
  • Loading branch information
moodler committed Dec 14, 2004
1 parent 1a5bc04 commit f5a1c0c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions mod/quiz/backuplib.php
Expand Up @@ -591,6 +591,7 @@ function quiz_backup_mods($bf,$preferences) {
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:
Expand Down
4 changes: 4 additions & 0 deletions mod/quiz/db/mysql.php
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions mod/quiz/db/mysql.sql
Expand Up @@ -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';
Expand Down
4 changes: 4 additions & 0 deletions mod/quiz/db/postgres7.php
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion mod/quiz/db/postgres7.sql
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions mod/quiz/restorelib.php
Expand Up @@ -1322,6 +1322,7 @@ function quiz_restore_mods($mod,$restore) {
$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
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/version.php
Expand Up @@ -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)?
Expand Down

0 comments on commit f5a1c0c

Please sign in to comment.