function view_upload_form() { global $CFG; if (isset($this->assignment->var3) && $this->assignment->var3 == self::ONLINE_TEXT) { notify(get_string("singleuploadwarning", "assignment_peerreview")); $mform = new mod_assignment_peerreview_edit_form($CFG->wwwroot . '/mod/assignment/upload.php', array('id' => $this->cm->id)); $mform->display(); } else { require_once $CFG->libdir . '/filelib.php'; $icon = mimeinfo('icon', 'xxx.' . $this->assignment->fileextension); $type = mimeinfo('type', 'xxx.' . $this->assignment->fileextension); $struploadafile = get_string("uploada", "assignment_peerreview") . " " . "<img align=\"middle\" src=\"" . $CFG->pixpath . "/f/" . $icon . "\" class=\"icon\" alt=\"" . $icon . "\" />" . "<strong>" . $type . "</strong> " . get_string("file", "assignment_peerreview") . " " . get_string("witha", "assignment_peerreview") . " <strong>." . $this->assignment->fileextension . "</strong> " . get_string("extension", "assignment_peerreview"); $strmaxsize = get_string("maxsize", "", display_size($this->assignment->maxbytes)); notify(get_string("singleuploadwarning", "assignment_peerreview")); echo '<div style="text-align:center">'; echo '<form enctype="multipart/form-data" method="post" ' . "action=\"{$CFG->wwwroot}/mod/assignment/upload.php\">"; echo '<fieldset class="invisiblefieldset">'; echo "<p>{$struploadafile} ({$strmaxsize})</p>"; echo '<input type="hidden" name="id" value="' . $this->cm->id . '" />'; require_once $CFG->libdir . '/uploadlib.php'; upload_print_form_fragment(1, array('newfile'), false, null, 0, $this->assignment->maxbytes, false); echo '<input type="submit" name="save" value="' . get_string('uploadthisfile') . '" />'; echo '</fieldset>'; echo '</form>'; echo '</div>'; } }
if (set_field('assignment_submissions', 'timemodified', time(), 'id', $submission->id)) { add_to_log($assignmentinstance->course->id, 'assignment', 'upload', 'view.php?a=' . $assignmentinstance->assignment->id, $assignmentinstance->assignment->id, $assignmentinstance->cm->id); notify(get_string('resubmissionsuccessful', 'assignment_peerreview'), 'notifysuccess'); } else { notify(get_string("uploadnotregistered", "assignment", $newfile_name)); } } } } } print_continue($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $assignmentinstance->cm->id); } else { if (isset($assignmentinstance->assignment->var3) && $assignmentinstance->assignment->var3 == assignment_peerreview::ONLINE_TEXT) { notify(get_string("resubmissionwarning", "assignment_peerreview")); $mform = new mod_assignment_peerreview_edit_form($CFG->wwwroot . '/mod/assignment/type/peerreview/resubmit.php', array('id' => $assignmentinstance->cm->id, 'a' => $assignmentinstance->assignment->id, 'userid' => $userid)); $mform->display(); } else { // Show form for resubmission notify(get_string("resubmissionwarning", "assignment_peerreview")); require_once $CFG->libdir . '/filelib.php'; $icon = mimeinfo('icon', 'xxx.' . $assignmentinstance->assignment->fileextension); $type = mimeinfo('type', 'xxx.' . $assignmentinstance->assignment->fileextension); $struploadafile = get_string("uploada", "assignment_peerreview") . " " . "<img align=\"middle\" src=\"" . $CFG->pixpath . "/f/" . $icon . "\" class=\"icon\" alt=\"" . $icon . "\" />" . "<strong>" . $type . "</strong> " . get_string("file", "assignment_peerreview") . " " . get_string("witha", "assignment_peerreview") . " <strong>." . $assignmentinstance->assignment->fileextension . "</strong> " . get_string("extension", "assignment_peerreview"); $strmaxsize = get_string("maxsize", "", display_size($assignmentinstance->assignment->maxbytes)); echo '<div style="text-align:center">'; echo '<form enctype="multipart/form-data" method="post" ' . "action=\"{$CFG->wwwroot}/mod/assignment/type/peerreview/resubmit.php\">"; echo '<fieldset class="invisiblefieldset">'; echo "<p>{$struploadafile} ({$strmaxsize})</p>"; echo '<input type="hidden" name="id" value="' . $assignmentinstance->cm->id . '" />'; echo '<input type="hidden" name="a" value="' . $assignmentinstance->assignment->id . '" />'; echo '<input type="hidden" name="userid" value="' . $userid . '" />';