unset unmodified text fields SC#140 + popup fix; merged from MOODLE_15_STABLE

This commit is contained in:
skodak
2005-07-12 13:12:24 +00:00
parent ed9e105ed8
commit d4156e8096
3 changed files with 13 additions and 5 deletions
+6 -4
View File
@@ -851,6 +851,9 @@ class assignment_base {
$newsubmission->mailed = 0; // Make sure mail goes out (again, even)
$newsubmission->timemarked = time();
unset($newsubmission->data1); // Don't need to update this.
unset($newsubmission->data2); // Don't need to update this.
if (empty($submission->timemodified)) { // eg for offline assignments
$newsubmission->timemodified = time();
}
@@ -1030,14 +1033,13 @@ class assignment_base {
require_once($CFG->libdir.'/filelib.php');
$icon = mimeinfo('icon', $file);
if ($CFG->slasharguments) {
$ffurl = "file.php/$filearea/$file";
$ffurl = "$CFG->wwwroot/file.php/$filearea/$file";
} else {
$ffurl = "file.php?file=/$filearea/$file";
$ffurl = "$CFG->wwwroot/file.php?file=/$filearea/$file";
}
$output = '<img align="middle" src="'.$CFG->pixpath.'/f/'.$icon.'" height="16" width="16" alt="'.$icon.'" />'.
link_to_popup_window ('/'.$ffurl, 'file'.$key, $file, 450, 580, $file, 'none', true).
'<br />';
'<a href="'.$ffurl.'" >'.$file.'</a><br />';
}
}
}
@@ -181,6 +181,7 @@ class assignment_online extends assignment_base {
$newsubmission->timemarked = time();
unset($newsubmission->data1); // Don't need to update this.
unset($newsubmission->data2); // Don't need to update this.
if (! update_record('assignment_submissions', $newsubmission)) {
return false;
@@ -85,6 +85,8 @@ class assignment_uploadsingle extends assignment_base {
$submission->timemodified = time();
$submission->numfiles = 1;
$submission->comment = addslashes($submission->comment);
unset($submission->data1); // Don't need to update this.
unset($submission->data2); // Don't need to update this.
if (update_record("assignment_submissions", $submission)) {
$this->email_teachers($submission);
print_heading(get_string('uploadedfile'));
@@ -140,7 +142,10 @@ class assignment_uploadsingle extends assignment_base {
$newsubmission->teacher = $USER->id;
$newsubmission->mailed = 0; // Make sure mail goes out (again, even)
$newsubmission->timemarked = time();
unset($newsubmission->data1); // Don't need to update this.
unset($newsubmission->data2); // Don't need to update this.
if (! update_record('assignment_submissions', $newsubmission)) {
return false;
}