Diff for /loncom/homework/lonhomework.pm between versions 1.105 and 1.106

version 1.105, 2002/12/11 15:33:55 version 1.106, 2003/01/19 08:11:38
Line 48  use Apache::optionresponse(); Line 48  use Apache::optionresponse();
 use Apache::imageresponse();  use Apache::imageresponse();
 use Apache::essayresponse();  use Apache::essayresponse();
 use Apache::externalresponse();  use Apache::externalresponse();
   use Apache::rankresponse();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use HTML::Entities();  use HTML::Entities();
 use Apache::loncommon();  use Apache::loncommon();
Line 150  sub check_access { Line 151  sub check_access {
   my $temp;    my $temp;
   my $type;    my $type;
   my $passed;    my $passed;
   
     if ($ENV{'request.state'} eq "construct") {
       &Apache::lonxml::debug("in construction ignoring dates");
       $status='CAN_ANSWER';
       $datemsg='is in under construction';
       return ($status,$datemsg);
     }
   
   &Apache::lonxml::debug("checking for part :$id:");    &Apache::lonxml::debug("checking for part :$id:");
   &Apache::lonxml::debug("time:".time);    &Apache::lonxml::debug("time:".time);
   foreach $temp ("opendate","duedate","answerdate") {    foreach $temp ("opendate","duedate","answerdate") {
Line 216  sub check_access { Line 225  sub check_access {
     $status='CAN_ANSWER';      $status='CAN_ANSWER';
     $datemsg='is closed but you are allowed to view it';      $datemsg='is closed but you are allowed to view it';
   }    }
   if ($ENV{'request.state'} eq "construct") {  
     &Apache::lonxml::debug("in construction ignoring dates");  
     $status='CAN_ANSWER';  
     $datemsg='is in under construction';  
   }  
   return ($status,$datemsg);    return ($status,$datemsg);
 }  }
   
Line 230  sub showhash { Line 235  sub showhash {
   return '';    return '';
 }  }
   
   sub showarray {
       my ($array)=@_;
       my $string="(";
       foreach my $elm (@{ $array }) {
    if (ref($elm)) {
       if ($elm =~ /ARRAY/ ) {
    $string.=&showarray($elm);
       }
    } else {
       $string.="$elm,"
    }
       }
       chop($string);
       $string.=")";
       return $string;
   }
   
 sub showhashsubset {  sub showhashsubset {
   my ($hash,$keyre) = @_;    my ($hash,$keyre) = @_;
   my $resultkey;    my $resultkey;
Line 237  sub showhashsubset { Line 259  sub showhashsubset {
     if ($resultkey =~ /$keyre/) {      if ($resultkey =~ /$keyre/) {
       if (ref($$hash{$resultkey})) {        if (ref($$hash{$resultkey})) {
  if ($$hash{$resultkey} =~ /ARRAY/ ) {   if ($$hash{$resultkey} =~ /ARRAY/ ) {
   my $string="$resultkey ---- (";      &Apache::lonxml::debug("$resultkey ---- ".
   foreach my $elm (@{ $$hash{$resultkey} }) {     &showarray($$hash{$resultkey}));
     $string.="$elm,";   } elsif ($$hash{$resultkey} =~ /HASH/ ) {
   }      &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");
   chop($string);      &showhashsubset($$hash{$resultkey},'.');
   &Apache::lonxml::debug("$string)");  
  } else {   } else {
   &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");      &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");
  }   }
       } else {        } else {
  &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");   &Apache::lonxml::debug("$resultkey ---- $$hash{$resultkey}");

Removed from v.1.105  
changed lines
  Added in v.1.106


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