fwrite ($bf,full_tag("TEXT",6,false,$jou_ent->text));
fwrite ($bf,full_tag("FORMAT",6,false,$jou_ent->format));
fwrite ($bf,full_tag("RATING",6,false,$jou_ent->rating));
- fwrite ($bf,full_tag("COMMENT",6,false,$jou_ent->comment));
+ fwrite ($bf,full_tag("ENTRYCOMMENT",6,false,$jou_ent->entrycomment));
fwrite ($bf,full_tag("TEACHER",6,false,$jou_ent->teacher));
fwrite ($bf,full_tag("TIMEMARKED",6,false,$jou_ent->timemarked));
fwrite ($bf,full_tag("MAILED",6,false,$jou_ent->mailed));
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/journal/db" VERSION="20060811" COMMENT="XMLDB file for Moodle mod/journal">
+<XMLDB PATH="mod/journal/db" VERSION="20060921" COMMENT="XMLDB file for Moodle mod/journal"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
<TABLES>
<TABLE NAME="journal" COMMENT="data for each journal" NEXT="journal_entries">
<FIELDS>
<FIELD NAME="modified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="text"/>
<FIELD NAME="text" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="modified" NEXT="format"/>
<FIELD NAME="format" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="text" NEXT="rating"/>
- <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="comment"/>
- <FIELD NAME="comment" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="rating" NEXT="teacher"/>
- <FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="comment" NEXT="timemarked"/>
+ <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="entrycomment"/>
+ <FIELD NAME="entrycomment" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="rating" NEXT="teacher"/>
+ <FIELD NAME="teacher" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entrycomment" NEXT="timemarked"/>
<FIELD NAME="timemarked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacher" NEXT="mailed"/>
<FIELD NAME="mailed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemarked"/>
</FIELDS>
AND je.id = RECORDID
</SQL_DETECT_COURSE>
</FIELD>
- <FIELD name="comment" method="PLAIN_SQL_UPDATE" type="text" length="0">
+ <FIELD name="entrycomment" method="PLAIN_SQL_UPDATE" type="text" length="0">
<SQL_DETECT_USER>
SELECT je.userid
FROM {$CFG->prefix}journal_entries je
execute_sql("UPDATE {$CFG->prefix}journal SET intro='' WHERE intro IS NULL");
table_column('journal','intro','intro','text','','','','not null');
}
+
+ if ($oldversion < 2006092100) {
+ table_column('journal_entries', 'comment', 'entrycomment', 'text', '', '', '');
+ }
+
return $result;
}
text text NOT NULL default '',
format tinyint(2) NOT NULL default '0',
rating int(10) default '0',
- comment text default '',
+ entrycomment text default '',
teacher int(10) unsigned NOT NULL default '0',
timemarked int(10) unsigned NOT NULL default '0',
mailed int(1) unsigned NOT NULL default '0',
$wtm->update( 'journal_entries', 'text', 'format', $sql );
}
+ if ($oldversion < 2006092100) {
+ table_column('journal_entries', 'comment', 'entrycomment', 'text', '', '', '');
+ }
+
return $result;
}
text text NOT NULL default '',
format integer NOT NULL default '0',
rating integer default '0',
- comment text,
+ entrycomment text,
teacher integer NOT NULL default '0',
timemarked integer NOT NULL default '0',
mailed integer NOT NULL default '0'
echo " <font size=\"1\">".userdate($entry->timemarked)."</font>";
}
echo "<br /><textarea name=\"c$entry->id\" rows=\"12\" cols=\"60\" wrap=\"virtual\">";
- p($entry->comment);
+ p($entry->entrycomment);
echo "</textarea><br />";
echo "</td></tr>";
}
}
echo '</div>';
- echo format_text($entry->comment);
+ echo format_text($entry->entrycomment);
echo '</td></tr></table>';
}
foreach ($feedback as $num => $vals) {
$entry = $entrybyentry[$num];
// Only update entries where feedback has actually changed.
- if (($vals['r'] <> $entry->rating) || ($vals['c'] <> addslashes($entry->comment))) {
+ if (($vals['r'] <> $entry->rating) || ($vals['c'] <> addslashes($entry->entrycomment))) {
$newentry->rating = $vals['r'];
- $newentry->comment = $vals['c'];
+ $newentry->entrycomment = $vals['c'];
$newentry->teacher = $USER->id;
$newentry->timemarked = $timenow;
$newentry->mailed = 0; // Make sure mail goes out (again, even)
$count++;
}
$entrybyuser[$entry->userid]->rating = $vals['r'];
- $entrybyuser[$entry->userid]->comment = $vals['c'];
+ $entrybyuser[$entry->userid]->entrycomment = $vals['c'];
$entrybyuser[$entry->userid]->teacher = $USER->id;
$entrybyuser[$entry->userid]->timemarked = $timenow;
}
$entry->text = backup_todb($entry_info['#']['TEXT']['0']['#']);
$entry->format = backup_todb($entry_info['#']['FORMAT']['0']['#']);
$entry->rating = backup_todb($entry_info['#']['RATING']['0']['#']);
- $entry->comment = backup_todb($entry_info['#']['COMMENT']['0']['#']);
+ if (isset(backup_todb($entry_info['#']['COMMENT']['0']['#']))) {
+ $entry->entrycomment = backup_todb($entry_info['#']['COMMENT']['0']['#']);
+ } else {
+ $entry->entrycomment = backup_todb($entry_info['#']['ENTRYCOMMENT']['0']['#']);
+ }
$entry->teacher = backup_todb($entry_info['#']['TEACHER']['0']['#']);
$entry->timemarked = backup_todb($entry_info['#']['TIMEMARKED']['0']['#']);
$date = usergetdate($entry->timemarked);
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006091201;
+$module->version = 2006092100;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
echo userdate($timefinish).'</div>';
}
- if ($entry->comment or $entry->rating) {
+ if ($entry->entrycomment or $entry->rating) {
$grades = make_grades_menu($journal->assessed);
print_heading(get_string('feedback'));
journal_print_feedback($course, $entry, $grades);