diff --git a/mod/assignment/backuplib.php b/mod/assignment/backuplib.php index 806781e2cad..de3f872d711 100644 --- a/mod/assignment/backuplib.php +++ b/mod/assignment/backuplib.php @@ -41,6 +41,7 @@ fwrite ($bf,full_tag("DESCRIPTION",4,false,$assignment->description)); fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format)); fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit)); + fwrite ($bf,full_tag("PREVENTLATE",4,false,$assignment->preventlate)); fwrite ($bf,full_tag("EMAILTEACHERS",4,false,$assignment->emailteachers)); fwrite ($bf,full_tag("VAR1",4,false,$assignment->var1)); fwrite ($bf,full_tag("VAR2",4,false,$assignment->var2)); diff --git a/mod/assignment/db/mysql.php b/mod/assignment/db/mysql.php index f6b110f658c..005ad8f4a24 100644 --- a/mod/assignment/db/mysql.php +++ b/mod/assignment/db/mysql.php @@ -150,6 +150,10 @@ function assignment_upgrade($oldversion) { table_column('assignment_submissions', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'comment'); } + if ($oldversion < 2005041800) { // Prevent late submissions? (default no) + table_column('assignment', '', 'preventlate', 'integer', '2', 'unsigned', '0', 'not null', 'resubmit'); + } + /// These lines ALWAYS need to be here at the end of this file. Don't mess with them. :-) include_once("$CFG->dirroot/mod/assignment/lib.php"); diff --git a/mod/assignment/db/mysql.sql b/mod/assignment/db/mysql.sql index dfcca264136..79973fb44ec 100644 --- a/mod/assignment/db/mysql.sql +++ b/mod/assignment/db/mysql.sql @@ -10,6 +10,7 @@ CREATE TABLE `prefix_assignment` ( `format` tinyint(4) unsigned NOT NULL default '0', `assignmenttype` varchar(50) NOT NULL default '', `resubmit` tinyint(2) unsigned NOT NULL default '0', + `preventlate` tinyint(2) unsigned NOT NULL default '0', `emailteachers` tinyint(2) unsigned NOT NULL default '0', `var1` int(10) default '0', `var2` int(10) default '0', diff --git a/mod/assignment/db/postgres7.php b/mod/assignment/db/postgres7.php index f91207bff5f..4a288a95013 100644 --- a/mod/assignment/db/postgres7.php +++ b/mod/assignment/db/postgres7.php @@ -148,6 +148,10 @@ function assignment_upgrade($oldversion) { table_column('assignment_submissions', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'comment'); } + if ($oldversion < 2005041800) { // Prevent late submissions? (default no) + table_column('assignment', '', 'preventlate', 'integer', '2', 'unsigned', '0', 'not null', 'resubmit'); + } + /// These lines ALWAYS need to be here at the end of this file. Don't mess with them. :-) include_once("$CFG->dirroot/mod/assignment/lib.php"); diff --git a/mod/assignment/db/postgres7.sql b/mod/assignment/db/postgres7.sql index 7a8ed394e5e..cf147fbe3ff 100644 --- a/mod/assignment/db/postgres7.sql +++ b/mod/assignment/db/postgres7.sql @@ -10,6 +10,7 @@ CREATE TABLE prefix_assignment ( format integer NOT NULL default '0', assignmenttype varchar(50) NOT NULL default '', resubmit integer NOT NULL default '0', + preventlate integer NOT NULL default '0', emailteachers integer NOT NULL default '0', var1 integer default '0', var2 integer default '0', diff --git a/mod/assignment/restorelib.php b/mod/assignment/restorelib.php index 6da50fc5b8f..1d3fd8c8ca5 100644 --- a/mod/assignment/restorelib.php +++ b/mod/assignment/restorelib.php @@ -44,6 +44,7 @@ $assignment->description = backup_todb($info['MOD']['#']['DESCRIPTION']['0']['#']); $assignment->format = backup_todb($info['MOD']['#']['FORMAT']['0']['#']); $assignment->resubmit = backup_todb($info['MOD']['#']['RESUBMIT']['0']['#']); + $assignment->preventlate = backup_todb($info['MOD']['#']['PREVENTLATE']['0']['#']); $assignment->emailteachers = backup_todb($info['MOD']['#']['EMAILTEACHERS']['0']['#']); $assignment->var1 = backup_todb($info['MOD']['#']['VAR1']['0']['#']); $assignment->var2 = backup_todb($info['MOD']['#']['VAR2']['0']['#']); diff --git a/mod/assignment/version.php b/mod/assignment/version.php index f28973ce108..4777af87f04 100644 --- a/mod/assignment/version.php +++ b/mod/assignment/version.php @@ -5,7 +5,7 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2005041700; +$module->version = 2005041800; $module->requires = 2005031000; // Requires this Moodle version $module->cron = 60;