--- loncom/interface/lonnavmaps.pm 2003/06/16 15:08:22 1.205 +++ loncom/interface/lonnavmaps.pm 2003/06/18 15:49:24 1.208 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.205 2003/06/16 15:08:22 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.208 2003/06/18 15:49:24 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,7 +92,10 @@ my %colormap = $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"; @@ -161,7 +164,6 @@ sub real_handler { # Now that we've displayed some stuff to the user, init the navmap $navmap->init(); - $r->print('
'); $r->rflush(); # Check that it's defined @@ -244,7 +246,7 @@ sub real_handler { } } else { $r->print("" . - "Go To My First Homework Problem
"); + "Go To My First Homework Problem    "); } my $suppressEmptySequences = 0; @@ -265,7 +267,7 @@ sub real_handler { $resource_no_folder_link = 1; } else { $r->print("" . - "Show Only Uncompleted Homework
"); + "Show Only Uncompleted Homework    "); } # renderer call @@ -414,7 +416,7 @@ sub dueInLessThen24Hours { 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(); @@ -1019,7 +1021,7 @@ sub render_long_status { $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) || @@ -1497,6 +1499,16 @@ sub render { } } continue { $curRes = $it->next(); + + if ($r) { + # If we have the connection, make sure the user is still connected + my $c = $r->connection; + if ($c->aborted()) { + Apache::lonnet::logthis("navmaps aborted"); + # Who cares what we do, nobody will see it anyhow. + return ''; + } + } } # Print out the part that jumps to #curloc if it exists