[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

bowersj2 lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 15:14:23 -0000


bowersj2		Wed Jun 18 11:14:23 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  Fix bug 1776: Navmaps should not display "attempted" problems in red 
  when there is less then 24 hours before the due date. Once the problems 
  are "attempted" the student can do no more about it.
  
  Also cleaned up a couple of other pieces of the code.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.206 loncom/interface/lonnavmaps.pm:1.207
--- loncom/interface/lonnavmaps.pm:1.206	Tue Jun 17 17:04:00 2003
+++ loncom/interface/lonnavmaps.pm	Wed Jun 18 11:14:23 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.206 2003/06/17 21:04:00 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.207 2003/06/18 15:14:23 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -92,7 +92,10 @@
       $resObj->TRIES_LEFT             => '',
       $resObj->INCORRECT              => '',
       $resObj->OPEN                   => '',
-      $resObj->NOTHING_SET            => '' );
+      $resObj->NOTHING_SET            => '',
+      $resObj->ATTEMPTED              => '',
+      $resObj->ANSWER_SUBMITTED       => ''
+      );
 # And a special case in the nav map; what to do when the assignment
 # is not yet done and due in less then 24 hours
 my $hurryUpColor = "#FF0000";
@@ -413,7 +416,7 @@
     my $part = shift;
     my $status = $res->status($part);
 
-    return ($status == $res->OPEN() || $status == $res->ATTEMPTED() ||
+    return ($status == $res->OPEN() ||
             $status == $res->TRIES_LEFT()) &&
            $res->duedate() && $res->duedate() < time()+(24*60*60) &&
            $res->duedate() > time();
@@ -1018,7 +1021,7 @@
         $params->{'multipart'} && $part eq "0";
                 
     my $color;
-    if ($resource->is_problem() && ($resource->countParts() <= 1 || $part ne '') ) {
+    if ($resource->is_problem() && ($resource->countParts() <= 1) ) {
         $color = $colormap{$resource->status};
         
         if (dueInLessThen24Hours($resource, $part) ||