Skip to content

Commit

Permalink
A very big batch of changes. Everything sort of works: now I'm moppin…
Browse files Browse the repository at this point in the history
…g up.
  • Loading branch information
moodler committed Apr 17, 2005
1 parent e9f7ee0 commit 73097f0
Show file tree
Hide file tree
Showing 17 changed files with 1,092 additions and 118 deletions.
5 changes: 5 additions & 0 deletions mod/assignment/backuplib.php
Expand Up @@ -42,6 +42,11 @@ function assignment_backup_mods($bf,$preferences) {
fwrite ($bf,full_tag("FORMAT",4,false,$assignment->format));
fwrite ($bf,full_tag("RESUBMIT",4,false,$assignment->resubmit));
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));
fwrite ($bf,full_tag("VAR3",4,false,$assignment->var3));
fwrite ($bf,full_tag("VAR4",4,false,$assignment->var4));
fwrite ($bf,full_tag("VAR5",4,false,$assignment->var5));
fwrite ($bf,full_tag("ASSIGNMENTTYPE",4,false,$assignment->assignmenttype));
fwrite ($bf,full_tag("MAXBYTES",4,false,$assignment->maxbytes));
fwrite ($bf,full_tag("TIMEDUE",4,false,$assignment->timedue));
Expand Down
9 changes: 9 additions & 0 deletions mod/assignment/db/mysql.php
Expand Up @@ -137,6 +137,15 @@ function assignment_upgrade($oldversion) {
table_column('assignment_submissions', '', 'data1', 'MEDIUMTEXT', '', '', '', 'not null', 'numfiles');
}

if ($oldversion < 2005041600) { // Add five new fields for general assignment parameters
// so most assignment types won't need new fields and backups stay simple
table_column('assignment', '', 'var5', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var4', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var3', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var2', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var1', 'integer', '10', '', 0, 'null', 'emailteachers');
}


/// 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");
Expand Down
5 changes: 5 additions & 0 deletions mod/assignment/db/mysql.sql
Expand Up @@ -11,6 +11,11 @@ CREATE TABLE `prefix_assignment` (
`assignmenttype` varchar(50) NOT NULL default '',
`resubmit` 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',
`var3` int(10) default '0',
`var4` int(10) default '0',
`var5` int(10) default '0',
`maxbytes` int(10) unsigned NOT NULL default '100000',
`timedue` int(10) unsigned NOT NULL default '0',
`timeavailable` int(10) unsigned NOT NULL default '0',
Expand Down
9 changes: 9 additions & 0 deletions mod/assignment/db/postgres7.php
Expand Up @@ -135,6 +135,15 @@ function assignment_upgrade($oldversion) {
table_column('assignment_submissions', '', 'data1', 'TEXT', '', '', '', 'not null', 'numfiles');
}

if ($oldversion < 2005041600) { // Add five new fields for general assignment parameters
// so most assignment types won't need new fields and backups stay simple
table_column('assignment', '', 'var5', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var4', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var3', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var2', 'integer', '10', '', 0, 'null', 'emailteachers');
table_column('assignment', '', 'var1', 'integer', '10', '', 0, 'null', 'emailteachers');
}



/// These lines ALWAYS need to be here at the end of this file. Don't mess with them. :-)
Expand Down
5 changes: 5 additions & 0 deletions mod/assignment/db/postgres7.sql
Expand Up @@ -11,6 +11,11 @@ CREATE TABLE prefix_assignment (
assignmenttype varchar(50) NOT NULL default '',
resubmit integer NOT NULL default '0',
emailteachers integer NOT NULL default '0',
var1 integer default '0',
var2 integer default '0',
var3 integer default '0',
var4 integer default '0',
var5 integer default '0',
maxbytes integer NOT NULL default '100000',
timedue integer NOT NULL default '0',
timeavailable integer NOT NULL default '0',
Expand Down
8 changes: 0 additions & 8 deletions mod/assignment/details.php
Expand Up @@ -19,14 +19,6 @@
redirect($CFG->wwwroot.'/course/view.php?id='.$course->id);
}

/// Set up things for a HTML editor if it's needed

if ($usehtmleditor = can_use_html_editor()) {
$defaultformat = FORMAT_HTML;
$editorfields = '';
} else {
$defaultformat = FORMAT_MOODLE;
}

require_once("$CFG->dirroot/mod/assignment/type/$form->assignmenttype/assignment.class.php");

Expand Down

0 comments on commit 73097f0

Please sign in to comment.