Diff for /loncom/homework/lonhomework.pm between versions 1.191 and 1.192

version 1.191, 2004/12/22 22:08:17 version 1.192, 2005/01/11 19:38:53
Line 320  sub check_access { Line 320  sub check_access {
     &Apache::lonxml::debug("looking for accesstime $first_access");      &Apache::lonxml::debug("looking for accesstime $first_access");
     if (!$first_access) {      if (!$first_access) {
  $status='NOT_YET_VIEWED';   $status='NOT_YET_VIEWED';
  $datemsg=' '.$interval.' seconds';   $datemsg=&seconds_to_human_length($interval);
     } else {      } else {
  my $newdate=localtime($first_access+$interval);   my $newdate=localtime($first_access+$interval);
  if (time > ($first_access+$interval)) {   if (time > ($first_access+$interval)) {
Line 348  sub check_access { Line 348  sub check_access {
     return ($status,$datemsg);      return ($status,$datemsg);
 }  }
   
   sub seconds_to_human_length {
       my ($length)=@_;
   
       my $seconds=$length%60; $length=int($length/60);
       my $minutes=$length%60; $length=int($length/60);
       my $hours=$length%24;   $length=int($length/24);
       my $days=$length;
   
       my $timestr;
       if ($days > 0) { $timestr.=&mt('[quant,_1,day]',$days); }
       if ($hours > 0) { $timestr.=($timestr?", ":"").
     &mt('[quant,_1,hour]',$hours); }
       if ($minutes > 0) { $timestr.=($timestr?", ":"").
       &mt('[quant,_1,minute]',$minutes); }
       if ($seconds > 0) { $timestr.=($timestr?", ":"").
       &mt('[quant,_1,second]',$seconds); }
       return $timestr;
   }
   
 sub showhash {  sub showhash {
     my (%hash) = @_;      my (%hash) = @_;
     &showhashsubset(\%hash,'.');      &showhashsubset(\%hash,'.');

Removed from v.1.191  
changed lines
  Added in v.1.192


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>