--- loncom/interface/lonnavdisplay.pm 2006/10/10 20:16:26 1.1 +++ loncom/interface/lonnavdisplay.pm 2007/04/20 01:54:29 1.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavdisplay.pm,v 1.1 2006/10/10 20:16:26 albertel Exp $ +# $Id: lonnavdisplay.pm,v 1.2 2007/04/20 01:54:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ use Apache::lonnavmaps(); use Apache::lonhtmlcommon(); use Apache::lonnet; use Apache::lonlocal; +use Time::HiRes qw( gettimeofday tv_interval ); sub handler { my $r = shift; @@ -224,19 +225,19 @@ MENU my $curRes; my $foundDoableProblem = 0; my $minimumduedate; - + my $now = time(); + while ($curRes = $iterator->next()) { if (ref($curRes) && $curRes->is_problem()) { my $status = $curRes->status(); - if ($curRes->completable()) { - my $thisduedate=$curRes->duedate(); - unless ($foundDoableProblem) { - $minimumduedate=$thisduedate; - } + my $thisduedate=$curRes->duedate(); + if ($thisduedate > $now + && $curRes->completable()) { $foundDoableProblem = 1; - if ($thisduedate<=$minimumduedate) { + if (!defined($minimumduedate) + || $thisduedate<$minimumduedate) { # Pop open all previous maps my $stack = $iterator->getStack(); pop @$stack; # last resource in the stack is the problem