id);
add_to_log($course->id, "assignment", "view all", "index.php?id=$course->id", "");
if ($course->category) {
$navigation = "id\">$course->shortname ->";
}
$strassignments = get_string("modulenameplural", "assignment");
$strassignment = get_string("modulename", "assignment");
$strweek = get_string("week");
$strtopic = get_string("topic");
$strname = get_string("name");
$strduedate = get_string("duedate", "assignment");
$strsubmitted = get_string("submitted", "assignment");
print_header("$course->shortname: $strassignments", "$course->fullname", "$navigation $strassignments", "", "", true, "", navmenu($course));
if (! $assignments = get_all_instances_in_course("assignment", $course)) {
notice("There are no assignments", "../../course/view.php?id=$course->id");
die;
}
$timenow = time();
if ($course->format == "weeks") {
$table->head = array ($strweek, $strname, $strduedate, $strsubmitted);
$table->align = array ("center", "left", "left", "left");
} else if ($course->format == "topics") {
$table->head = array ($strtopic, $strname, $strduedate, $strsubmitted);
$table->align = array ("center", "left", "left", "left");
} else {
$table->head = array ($strname, $strduedate, $strsubmitted);
$table->align = array ("left", "left", "left");
}
foreach ($assignments as $assignment) {
if (isteacher($course->id)) {
if ($assignment->type == OFFLINE) {
$submitted = "id\">" .
get_string("viewfeedback", "assignment") . "";
} else {
$count = count_records_select("assignment_submissions",
"assignment = '$assignment->id' AND timemodified > 0");
$submitted = "id\">" .
get_string("viewsubmissions", "assignment", $count) . "";
}
} else {
if ($submission = assignment_get_submission($assignment, $USER)) {
if ($submission->timemodified <= $assignment->timedue) {
$submitted = userdate($submission->timemodified);
} else {
$submitted = "".userdate($submission->timemodified)."";
}
} else {
$submitted = get_string("no");
}
}
$due = userdate($assignment->timedue);
if (!$assignment->visible) {
//Show dimmed if the mod is hidden
$link = "coursemodule\">$assignment->name";
} else {
//Show normal if the mod is visible
$link = "coursemodule\">$assignment->name";
}
if ($assignment->section) {
$section = "$assignment->section";
} else {
$section = "";
}
if ($course->format == "weeks" or $course->format == "topics") {
$table->data[] = array ($section, $link, $due, $submitted);
} else {
$table->data[] = array ($link, $due, $submitted);
}
}
echo "
";
print_table($table);
print_footer($course);
?>