Diff for /loncom/homework/lonhomework.pm between versions 1.29 and 1.34

version 1.29, 2001/01/09 19:50:14 version 1.34, 2001/01/15 21:44:21
Line 12  use Apache::inputtags; Line 12  use Apache::inputtags;
 use Apache::structuretags;  use Apache::structuretags;
 use Apache::response;  use Apache::response;
 use Apache::hint;  use Apache::hint;
   use Apache::outputtags;
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
   
 sub get_target {  sub get_target {
   if ( $ENV{'request.state'} eq "published") {    if ( $ENV{'request.state'} eq "published") {
     if ( defined $ENV{'form.submit'}) {      if ( defined $ENV{'form.submitted'}) {
       return ('grade', 'web');        return ('grade', 'web');
     } else {      } else {
       return ('web');        return ('web');
     }      }
   } elsif ($ENV{'request.state'} eq "construct") {    } elsif ($ENV{'request.state'} eq "construct") {
     if ( defined $ENV{'form.preview'}) {      if ( defined $ENV{'form.preview'}) {
       if ( defined $ENV{'form.submit'}) {        if ( defined $ENV{'form.submitted'}) {
  return ('grade', 'web');   return ('grade', 'web');
       } else {        } else {
  return ('web');   return ('web');
Line 74  sub check_date { Line 75  sub check_date {
     &Apache::lonxml::debug("found :$date: for :$temp:");      &Apache::lonxml::debug("found :$date: for :$temp:");
     if ($date eq '') {      if ($date eq '') {
       $date = "an unknown date"; $passed = 0;        $date = "an unknown date"; $passed = 0;
       } elsif ($date eq 'con_lost') {
         $date = "an indeterminate date"; $passed = 0;
     } else {      } else {
       if (time < $date) { $passed = 0; } else { $passed = 1; }        if (time < $date) { $passed = 0; } else { $passed = 1; }
       $date = localtime $date;        $date = localtime $date;
Line 92  sub check_date { Line 95  sub check_date {
     $datemsg = "is due at $date";      $datemsg = "is due at $date";
   } elsif ($type eq 'answerdate') {    } elsif ($type eq 'answerdate') {
     $status='CLOSED';      $status='CLOSED';
     $datemsg = "was due as $lastdate, and answers will be available at $date";      $datemsg = "was due on $lastdate, and answers will be available on $date";
   }    }
   if ($status eq 'CAN_ANSWER') {    if ($status eq 'CAN_ANSWER') {
     #check #tries      #check #tries
Line 114  sub check_date { Line 117  sub check_date {
 sub handler {  sub handler {
   my $request=$_[0];    my $request=$_[0];
   
   if ( $ENV{'user.name'} eq 'albertel' ) { $Apache::lonxml::debug=1; }    if ( $ENV{'user.name'} eq 'albertel' ) {$Apache::lonxml::debug=1;} else {$Apache::lonxml::debug=0;}
       
   my (@targets) = &get_target();    my (@targets) = &get_target();
   

Removed from v.1.29  
changed lines
  Added in v.1.34


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