Diff for /loncom/homework/lonhomework.pm between versions 1.221 and 1.225

version 1.221, 2005/11/08 21:09:08 version 1.225, 2005/11/15 21:39:33
Line 236  sub check_task_access { Line 236  sub check_task_access {
     my ($status,$datemsg)=&check_access;      my ($status,$datemsg)=&check_access;
     if ($status eq 'SHOW_ANSWER' ||      if ($status eq 'SHOW_ANSWER' ||
  $status eq 'CLOSED' ||   $status eq 'CLOSED' ||
  $status eq 'CANNOT_ANSWER' ||  
  $status eq 'INVALID_ACCESS' ||   $status eq 'INVALID_ACCESS' ||
  $status eq 'UNAVAILABLE') {   $status eq 'UNAVAILABLE') {
  return ($status,$datemsg);   return ($status,$datemsg);
Line 286  sub check_task_access { Line 285  sub check_task_access {
     return ('WAITING_FOR_GRADE');      return ('WAITING_FOR_GRADE');
  }   }
     }      }
       if ( $status eq 'CANNOT_ANSWER' && 
    ($slotstatus ne 'NEEDS_CHECKIN' && $slotstatus ne 'NOT_IN_A_SLOT')) {
    return ($status,$datemsg);
       }
   
     return ($slotstatus,$datemsg,$slot_name,$returned_slot);      return ($slotstatus,$datemsg,$slot_name,$returned_slot);
 }  }
   
Line 766  sub renderpage { Line 770  sub renderpage {
     $target = 'web'; $output=0;      $target = 'web'; $output=0;
  }   }
  my $problem=&Apache::lonnet::getfile($file);   my $problem=&Apache::lonnet::getfile($file);
    my $result;
  if ($problem eq -1) {   if ($problem eq -1) {
     &Apache::lonxml::error("<b> ".&mt('Unable to find')." <i>$file</i></b>");      my $filename=(split('/',$file))[-1];
       $result.="<b> ".&mt('Unable to find')." <i>$filename</i></b>";
     $problem='';      $problem='';
  }   }
   
Line 777  sub renderpage { Line 783  sub renderpage {
  if ($target eq 'web') {&Apache::lonhomework::showhashsubset(\%env,'^form');}   if ($target eq 'web') {&Apache::lonhomework::showhashsubset(\%env,'^form');}
   
  &Apache::lonxml::debug("Should be parsing now");   &Apache::lonxml::debug("Should be parsing now");
  my $result = &Apache::lonxml::xmlparse($request, $target, $problem,   $result .= &Apache::lonxml::xmlparse($request, $target, $problem,
        &setup_vars($target),%mystyle);       &setup_vars($target),%mystyle);
  undef($Apache::lonhomework::parsing_a_problem);   undef($Apache::lonhomework::parsing_a_problem);
  if (!$output) { $result = ''; }   if (!$output) { $result = ''; }
  #$request->print("Result follows:");   #$request->print("Result follows:");
Line 917  EDITMENU Line 923  EDITMENU
 sub handler {  sub handler {
     #my $t0 = [&gettimeofday()];      #my $t0 = [&gettimeofday()];
     my $request=$_[0];      my $request=$_[0];
           $Apache::lonxml::request=$request;
     $Apache::lonxml::debug=$env{'user.debug'};      $Apache::lonxml::debug=$env{'user.debug'};
     $env{'request.uri'}=$request->uri;      $env{'request.uri'}=$request->uri;
     &setuppermissions();      &setuppermissions();
Line 937  sub handler { Line 943  sub handler {
  if ($Apache::lonhomework::browse ne 'F' &&    if ($Apache::lonhomework::browse ne 'F' && 
     $env{'request.state'} ne "construct") {      $env{'request.state'} ne "construct") {
     #should know where we are, so ask      #should know where we are, so ask
     if ( &Apache::lonnet::mod_perl_version() == 2 ) {  
  &Apache::lonnet::cleanenv();  
     }  
     &Apache::lonnet::logthis(&Apache::lonnet::mod_perl_version());  
     $request->internal_redirect('/adm/ambiguous'); return OK;      $request->internal_redirect('/adm/ambiguous'); return OK;
  }   }
     }      }

Removed from v.1.221  
changed lines
  Added in v.1.225


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