Some polishing for the case when grades are set to zero (no grades).
authormoodler <moodler>
Mon, 18 Aug 2003 04:24:12 +0000 (04:24 +0000)
committermoodler <moodler>
Mon, 18 Aug 2003 04:24:12 +0000 (04:24 +0000)
Also, if the date is set further than on year into the future
then the due date is not shown.

mod/assignment/lib.php
mod/assignment/mod.html
mod/assignment/submissions.php
mod/assignment/view.php

index cbe56171427baada9f2aa7f9a8b96948fe940964..31342460ea9f6e9f11caf7696529ab1edab2dff4 100644 (file)
@@ -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 "&nbsp;&nbsp;<FONT SIZE=1>".userdate($submission->timemarked)."</FONT>";
     }
index eb7f8001d893d4874dc03c301b21bdce916ebe3f..7bcea693f1e1714b249ff60ed900d79276da6481 100644 (file)
         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", "");
index 2bc61f7de8bc2adfdc4f466ddcd2f9108d3a8698..c370eb7bff30cfb65f281c8cb1b3913eb8b7e6d6 100644 (file)
         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
index 077a82d58387a71c272417be38ad3c1b43628422..02d789e8391caa6c3be4aac38b1acfedbc17db7e 100644 (file)
         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();
             }
             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);