--- loncom/homework/lonhomework.pm 2006/06/30 05:10:29 1.255 +++ loncom/homework/lonhomework.pm 2006/07/20 03:57:38 1.257 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.255 2006/06/30 05:10:29 albertel Exp $ +# $Id: lonhomework.pm,v 1.257 2006/07/20 03:57:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -480,7 +480,11 @@ sub check_access { if (!$first_access) { $status='NOT_YET_VIEWED'; my $due_date = &due_date($id); - $datemsg=&seconds_to_human_length($due_date-time); + my $seconds_left = $due_date - time; + if ($seconds_left > $interval || $due_date eq '') { + $seconds_left = $interval; + } + $datemsg=&seconds_to_human_length($seconds_left); } } } @@ -510,8 +514,9 @@ sub due_date { my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb, $udom,$uname); &Apache::lonxml::debug("looking for due_date $part_id $symb $due_date"); - if (defined($interval)) { + if ($interval =~ /\d+/) { my $first_access=&Apache::lonnet::get_first_access('map',$symb); + &Apache::lonxml::debug("looking for first_access $first_access"); if (defined($first_access)) { $interval = $first_access+$interval; $date = ($interval < $due_date)? $interval : $due_date;