Some polishing for the case when grades are set to zero (no grades).
Also, if the date is set further than on year into the future then the due date is not shown.
This commit is contained in:
@@ -400,7 +400,7 @@ function assignment_print_submission($assignment, $user, $submission, $teachers,
|
||||
echo "<TD BGCOLOR=\"$THEME->cellheading\">";
|
||||
}
|
||||
echo get_string("feedback", "assignment").":";
|
||||
choose_from_menu($grades, "g$submission->id", $submission->grade, get_string("grade")."...");
|
||||
choose_from_menu($grades, "g$submission->id", $submission->grade, get_string("nograde"));
|
||||
if ($submission->timemarked) {
|
||||
echo " <FONT SIZE=1>".userdate($submission->timemarked)."</FONT>";
|
||||
}
|
||||
|
||||
@@ -103,7 +103,8 @@
|
||||
foreach ($scales as $i => $scalename) {
|
||||
$grades[-$i] = "$strscale: $scalename";
|
||||
}
|
||||
for ($i=100; $i>=0; $i--) {
|
||||
$grades[0] = get_string("nograde");
|
||||
for ($i=100; $i>=1; $i--) {
|
||||
$grades[$i] = $i;
|
||||
}
|
||||
choose_from_menu($grades, "grade", "$form->grade", "");
|
||||
|
||||
@@ -133,10 +133,12 @@
|
||||
if ($scale = get_record("scale", "id", $scaleid)) {
|
||||
$grades = make_menu_from_list($scale->scale);
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=$assignment->grade; $i>=0; $i--) {
|
||||
$grades[$i] = $i;
|
||||
} else if ($assignment->grade == 0) {
|
||||
$grades = NULL;
|
||||
} else {
|
||||
for ($i=$assignment->grade; $i>=0; $i--) {
|
||||
$grades[$i] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
// Submission sorting
|
||||
|
||||
+11
-11
@@ -60,17 +60,18 @@
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
|
||||
$strdifference = format_time($assignment->timedue - time());
|
||||
if (($assignment->timedue - time()) < 0) {
|
||||
$strdifference = "<FONT COLOR=RED>$strdifference</FONT>";
|
||||
}
|
||||
$strduedate = userdate($assignment->timedue)." ($strdifference)";
|
||||
|
||||
print_simple_box_start("CENTER");
|
||||
print_heading($assignment->name, "CENTER");
|
||||
print_simple_box_start("CENTER");
|
||||
echo "<b>".get_string("duedate", "assignment")."</b>: $strduedate<br />";
|
||||
|
||||
$timedifference = $assignment->timedue - time();
|
||||
if ($timedifference < 31536000) { // Don't bother showing dates over a year in the future
|
||||
$strdifference = format_time($timedifference);
|
||||
if ($timedifference < 0) {
|
||||
$strdifference = "<font color=\"red\">$strdifference</font>";
|
||||
}
|
||||
$strduedate = userdate($assignment->timedue)." ($strdifference)";
|
||||
echo "<b>".get_string("duedate", "assignment")."</b>: $strduedate<br />";
|
||||
}
|
||||
|
||||
if ($assignment->grade < 0) {
|
||||
$scaleid = - ($assignment->grade);
|
||||
@@ -84,7 +85,6 @@
|
||||
echo "<b>".get_string("maximumgrade")."</b>: $assignment->grade<br>";
|
||||
}
|
||||
|
||||
print_simple_box_end();
|
||||
echo "<br />";
|
||||
echo format_text($assignment->description, $assignment->format);
|
||||
print_simple_box_end();
|
||||
@@ -120,7 +120,7 @@
|
||||
}
|
||||
if (!$submission->timemarked or $assignment->resubmit) {
|
||||
if ($submission and $submission->timemodified) {
|
||||
echo "<P ALIGN=CENTER>".get_string("overwritewarning", "assignment")."</P>";
|
||||
echo "<p align=\"center\">".get_string("overwritewarning", "assignment")."</p>";
|
||||
}
|
||||
print_heading(get_string("submitassignment", "assignment").":", "center");
|
||||
assignment_print_upload_form($assignment);
|
||||
|
||||
Reference in New Issue
Block a user