Diff for /loncom/homework/lonhomework.pm between versions 1.233.2.2 and 1.234

version 1.233.2.2, 2006/04/21 15:27:30 version 1.234, 2006/02/10 23:44:53
Line 278  sub check_slot_access { Line 278  sub check_slot_access {
     my $slotstatus='NOT_IN_A_SLOT';      my $slotstatus='NOT_IN_A_SLOT';
     my ($returned_slot,$slot_name);      my ($returned_slot,$slot_name);
     foreach my $slot (@slots) {      foreach my $slot (@slots) {
  $slot =~ s/(^\s*|\s*$)//g;  
  &Apache::lonxml::debug("getting $slot");   &Apache::lonxml::debug("getting $slot");
  my %slot=&Apache::lonnet::get_slot($slot);   my %slot=&Apache::lonnet::get_slot($slot);
  &Apache::lonhomework::showhash(%slot);   &Apache::lonhomework::showhash(%slot);
Line 298  sub check_slot_access { Line 297  sub check_slot_access {
  $slotstatus='CAN_ANSWER';   $slotstatus='CAN_ANSWER';
     }      }
   
     my ($is_correct,$got_grade,$checkedin);      my ($got_grade,$checkedin);
     if ($type eq 'Task') {      if ($type eq 'Task') {
  my $version=$Apache::lonhomework::history{'resource.0.version'};   my $version=$Apache::lonhomework::history{'resource.0.version'};
  $got_grade =    $got_grade = 
     ($Apache::lonhomework::history{"resource.$version.0.status"}       ($Apache::lonhomework::history{"resource.$version.0.status"} 
      =~ /^(?:pass|fail)$/);       =~ /^(?:pass|fail)$/);
  $is_correct =    
     ($Apache::lonhomework::history{"resource.$version.0.status"} eq 'pass'  
      || $Apache::lonhomework::history{"resource.0.solved"} =~ /^correct_/ );  
  $checkedin =   $checkedin =
     $Apache::lonhomework::history{"resource.$version.0.checkedin"};      $Apache::lonhomework::history{"resource.$version.0.checkedin"};
     } elsif ($type eq 'problem') {      } elsif ($type eq 'problem') {
Line 314  sub check_slot_access { Line 310  sub check_slot_access {
  $checkedin = $Apache::lonhomework::history{"resource.0.checkedin"};   $checkedin = $Apache::lonhomework::history{"resource.0.checkedin"};
     }      }
           
     &Apache::lonxml::debug(" slot is $slotstatus checkedin ($checkedin) got_grade ($got_grade) is_correct ($is_correct)");  
       
     if ($slotstatus eq 'NOT_IN_A_SLOT'       if ($slotstatus eq 'NOT_IN_A_SLOT' 
  && $checkedin ) {   && $checkedin ) {
   
Line 326  sub check_slot_access { Line 320  sub check_slot_access {
  }   }
   
     }      }
     if ( $is_correct) {  
  return ('SHOW_ANSWER');  
     }  
     if ( $status eq 'CANNOT_ANSWER' &&       if ( $status eq 'CANNOT_ANSWER' && 
  ($slotstatus ne 'NEEDS_CHECKIN' && $slotstatus ne 'NOT_IN_A_SLOT')) {   ($slotstatus ne 'NEEDS_CHECKIN' && $slotstatus ne 'NOT_IN_A_SLOT')) {
  return ($status,$datemsg);   return ($status,$datemsg);
Line 999  sub handler { Line 990  sub handler {
     &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});      &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});
     my ($symb) = &Apache::lonxml::whichuser();      my ($symb) = &Apache::lonxml::whichuser();
     &Apache::lonxml::debug('symb is '.$symb);      &Apache::lonxml::debug('symb is '.$symb);
     if ($env{'request.state'} eq "construct" || $symb eq '') {  
  if ($env{'form.resetdata'} eq &mt('Reset Submissions') ||  
     $env{'form.resetdata'} eq &mt('New Problem Variation') ||  
     $env{'form.newrandomization'} eq &mt('New Randomization')) {  
     my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();  
     &Apache::lonnet::tmpreset($symb,'',$domain,$name);  
     &Apache::lonxml::debug("Attempt reset");  
  }  
     }  
     if ($env{'request.state'} eq "construct") {      if ($env{'request.state'} eq "construct") {
  if ( -e $file ) {   if ( -e $file ) {
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},

Removed from v.1.233.2.2  
changed lines
  Added in v.1.234


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