diff --git a/mod/assignment/backuplib.php b/mod/assignment/backuplib.php index fd6dcdd60bd..806781e2cad 100644 --- a/mod/assignment/backuplib.php +++ b/mod/assignment/backuplib.php @@ -96,6 +96,7 @@ fwrite ($bf,full_tag("DATA2",6,false,$ass_sub->data2)); fwrite ($bf,full_tag("GRADE",6,false,$ass_sub->grade)); fwrite ($bf,full_tag("COMMENT",6,false,$ass_sub->comment)); + fwrite ($bf,full_tag("FORMAT",6,false,$ass_sub->format)); fwrite ($bf,full_tag("TEACHER",6,false,$ass_sub->teacher)); fwrite ($bf,full_tag("TIMEMARKED",6,false,$ass_sub->timemarked)); fwrite ($bf,full_tag("MAILED",6,false,$ass_sub->mailed)); diff --git a/mod/assignment/db/mysql.php b/mod/assignment/db/mysql.php index facf386c1de..f6b110f658c 100644 --- a/mod/assignment/db/mysql.php +++ b/mod/assignment/db/mysql.php @@ -146,6 +146,10 @@ function assignment_upgrade($oldversion) { table_column('assignment', '', 'var1', 'integer', '10', '', 0, 'null', 'emailteachers'); } + if ($oldversion < 2005041700) { // Allow comments to have a formatting + table_column('assignment_submissions', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'comment'); + } + /// 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 9a5aaa46bef..dfcca264136 100644 --- a/mod/assignment/db/mysql.sql +++ b/mod/assignment/db/mysql.sql @@ -7,7 +7,7 @@ CREATE TABLE `prefix_assignment` ( `course` int(10) unsigned NOT NULL default '0', `name` varchar(255) NOT NULL default '', `description` text NOT NULL, - `format` tinyint(2) unsigned NOT NULL default '0', + `format` tinyint(4) unsigned NOT NULL default '0', `assignmenttype` varchar(50) NOT NULL default '', `resubmit` tinyint(2) unsigned NOT NULL default '0', `emailteachers` tinyint(2) unsigned NOT NULL default '0', @@ -41,6 +41,7 @@ CREATE TABLE `prefix_assignment_submissions` ( `data2` text NOT NULL, `grade` int(11) NOT NULL default '0', `comment` text NOT NULL, + `format` tinyint(4) unsigned NOT NULL default '0', `teacher` int(10) unsigned NOT NULL default '0', `timemarked` int(10) unsigned NOT NULL default '0', `mailed` tinyint(1) unsigned NOT NULL default '0', diff --git a/mod/assignment/db/postgres7.php b/mod/assignment/db/postgres7.php index 3223ab4a7e0..f91207bff5f 100644 --- a/mod/assignment/db/postgres7.php +++ b/mod/assignment/db/postgres7.php @@ -144,6 +144,9 @@ function assignment_upgrade($oldversion) { table_column('assignment', '', 'var1', 'integer', '10', '', 0, 'null', 'emailteachers'); } + if ($oldversion < 2005041700) { // Allow comments to have a formatting + table_column('assignment_submissions', '', 'format', 'integer', '4', 'unsigned', '0', 'not null', 'comment'); + } /// These lines ALWAYS need to be here at the end of this file. Don't mess with them. :-) diff --git a/mod/assignment/db/postgres7.sql b/mod/assignment/db/postgres7.sql index 495b4d96c5e..7a8ed394e5e 100644 --- a/mod/assignment/db/postgres7.sql +++ b/mod/assignment/db/postgres7.sql @@ -42,6 +42,7 @@ CREATE TABLE prefix_assignment_submissions ( data2 text NOT NULL default '', grade integer NOT NULL default '0', comment text NOT NULL default '', + format integer NOT NULL default '0', teacher integer NOT NULL default '0', timemarked integer NOT NULL default '0', mailed integer NOT NULL default '0' diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index f1b9f075a4f..13ab4d1000a 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -189,6 +189,7 @@ class assignment_base { echo '
'; - print_textarea($this->usehtmleditor, 10, 60, 0, 0, 'comment', $submission->comment, $this->course->id); + print_textarea($this->usehtmleditor, 15, 58, 0, 0, 'comment', $submission->comment, $this->course->id); echo '