course)) { error("Course is misconfigured"); } if (! $assignment = get_record("assignment", "id", $cm->instance)) { error("Course module is incorrect"); } } else { if (! $assignment = get_record("assignment", "id", $a)) { error("Course module is incorrect"); } if (! $course = get_record("course", "id", $assignment->course)) { error("Course is misconfigured"); } if (! $cm = get_coursemodule_from_instance("assignment", $assignment->id, $course->id)) { error("Course Module ID was incorrect"); } } require_login($course->id); add_to_log($course->id, "assignment", "view", "view.php?id=$cm->id", "$assignment->id"); if ($course->category) { $navigation = "id\">$course->shortname ->"; } $strassignments = get_string("modulenameplural", "assignment"); $strassignment = get_string("modulename", "assignment"); print_header("$course->shortname: $assignment->name", "$course->fullname", "$navigation id>$strassignments -> $assignment->name", "", "", true, update_module_button($cm->id, $course->id, $strassignment)); if (isteacher($course->id)) { if ($submissions = assignment_get_all_submissions($assignment)) { $count = count($submissions); } else { $count = 0; } echo "
id\">". get_string("viewsubmissions", "assignment", $count)."
"; } $strdifference = format_time($assignment->timedue - time()); $strduedate = userdate($assignment->timedue)." ($strdifference)"; print_simple_box_start("CENTER"); print_heading($assignment->name, "CENTER"); print_simple_box_start("CENTER"); echo "".get_string("duedate", "assignment").": $strduedate".get_string("lastmodified").": ".userdate($submission->timemodified)."
"; assignment_print_user_files($assignment, $USER); print_simple_box_end(); } else { print_heading(get_string("notsubmittedyet","assignment")); } echo "".get_string("overwritewarning", "assignment")."
"; } print_heading(get_string("submitassignment", "assignment").":", "CENTER"); assignment_print_upload_form($assignment); } } print_footer($course); ?>