function print_user_files($userid, $return = false) { global $CFG; if (!($submission = $this->get_submission($userid))) { return ''; } // Construct a Sloodle submission object $sloodle_submission = new assignment_sloodleobject_submission(); $sloodle_submission->load_submission($submission); // Display the number of prims $num_prims = $sloodle_submission->num_prims; if ($num_prims == 0) { $num_prims = '?'; } print_simple_box_start('center', '', '', 0, 'generalbox', 'wordcount'); echo ' (' . get_string('numprims', 'sloodle', $num_prims) . ')'; print_simple_box_end(); // Display the text summary of this submission print_simple_box($sloodle_submission->text_summary(), 'center', '100%'); }
} if (!($user = get_record("user", "id", $userid))) { error("User is misconfigured"); } require_login($course->id, false, $cm); if ($USER->id != $user->id && !has_capability('mod/assignment:grade', get_context_instance(CONTEXT_MODULE, $cm->id))) { error("You can not view this assignment"); } if ($assignment->assignmenttype != 'sloodleobject') { error("Incorrect assignment type"); } $assignmentinstance = new assignment_sloodleobject($cm->id, $assignment, $cm, $course); if ($submission = $assignmentinstance->get_submission($user->id)) { print_header(fullname($user, true) . ': ' . $assignment->name); // Get the Sloodle submission data $sloodle_submission = new assignment_sloodleobject_submission(); $sloodle_submission->load_submission($submission); print_simple_box_start('center', '', '', '', 'generalbox', 'dates'); echo '<table>'; if ($assignment->timedue) { echo '<tr><td class="c0">' . get_string('duedate', 'assignment') . ':</td>'; echo ' <td class="c1">' . userdate($assignment->timedue) . '</td></tr>'; } echo '<tr><td class="c0">' . get_string('lastedited') . ':</td>'; echo ' <td class="c1">' . userdate($submission->timemodified); // Show the number of prims $num_prims = $sloodle_submission->num_prims; if ($num_prims == 0) { $num_prims = '?'; } echo ' (' . get_string('numprims', 'sloodle', $num_prims) . ')</td></tr>';