Diff for /loncom/homework/lonhomework.pm between versions 1.248 and 1.252

version 1.248, 2006/05/16 21:21:32 version 1.252, 2006/06/20 05:10:00
Line 170  sub proctor_checked_in { Line 170  sub proctor_checked_in {
     } elsif ($type eq 'problem') {      } elsif ($type eq 'problem') {
  $key ='resource.0.checkedin';   $key ='resource.0.checkedin';
     }      }
           # backward compatability, used to be username@domain, 
       # now is username:domain
       my $who = $Apache::lonhomework::history{$key};
       if ($who !~ /:/) {
    $who =~ tr/@/:/;
       }     
     foreach my $possible (@possible_proctors) {       foreach my $possible (@possible_proctors) { 
  if ($Apache::lonhomework::history{$key} eq $possible   if ($who eq $possible
     && $Apache::lonhomework::history{$key.'.slot'} eq $slot_name) {      && $Apache::lonhomework::history{$key.'.slot'} eq $slot_name) {
     return 1;      return 1;
  }   }
Line 239  sub check_slot_access { Line 244  sub check_slot_access {
     # does it pass normal muster      # does it pass normal muster
     my ($status,$datemsg)=&check_access($id);      my ($status,$datemsg)=&check_access($id);
           
     my $useslots = &Apache::lonnet::EXT("resource.$id.useslots");      my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
     if ($useslots ne 'resource' && $useslots ne 'map') {      if ($useslots ne 'resource' && $useslots ne 'map' 
    && $useslots ne 'map_map') {
  return ($status,$datemsg);   return ($status,$datemsg);
     }      }
   
Line 263  sub check_slot_access { Line 269  sub check_slot_access {
     }      }
   
     my @slots=      my @slots=
  (split(':',&Apache::lonnet::EXT("resource.$id.availablestudent")),   (split(':',&Apache::lonnet::EXT("resource.0.availablestudent")),
  split(':',&Apache::lonnet::EXT("resource.$id.available")));   split(':',&Apache::lonnet::EXT("resource.0.available")));
   
 #    if (!@slots) {  #    if (!@slots) {
 # return ($status,$datemsg);  # return ($status,$datemsg);
Line 304  sub check_slot_access { Line 310  sub check_slot_access {
  $checkedin =   $checkedin =
     $Apache::lonhomework::history{"resource.$version.0.checkedin"};      $Apache::lonhomework::history{"resource.$version.0.checkedin"};
     } elsif ($type eq 'problem') {      } elsif ($type eq 'problem') {
  $got_grade = 1;   $got_grade  = 1;
  $checkedin = $Apache::lonhomework::history{"resource.0.checkedin"};   $checkedin  = $Apache::lonhomework::history{"resource.0.checkedin"};
    $is_correct =
       ($Apache::lonhomework::history{"resource.0.solved"} =~/^correct_/);
     }      }
           
     &Apache::lonxml::debug(" slot is $slotstatus checkedin ($checkedin) got_grade ($got_grade) is_correct ($is_correct)");      &Apache::lonxml::debug(" slot is $slotstatus checkedin ($checkedin) got_grade ($got_grade) is_correct ($is_correct)");
Line 318  sub check_slot_access { Line 326  sub check_slot_access {
  return ('WAITING_FOR_GRADE');   return ('WAITING_FOR_GRADE');
     }      }
   
       # no slot is currently open, and has been checked in for this version
       # previous slot is therefore CLOSED, so therefore the problem is
       if (!defined($slot_name)
    && $checkedin 
    && $type eq 'problem') {
    return ('CLOSED',$datemsg);
       }
   
     if ($slotstatus eq 'NOT_IN_A_SLOT'       if ($slotstatus eq 'NOT_IN_A_SLOT' 
  && $checkedin ) {   && $checkedin ) {
   
Line 481  sub check_access { Line 497  sub check_access {
 }  }
 # this should work exactly like the copy in lonnavmaps.pm  # this should work exactly like the copy in lonnavmaps.pm
 sub due_date {  sub due_date {
     my ($part_id,$symb)=@_;      my ($part_id,$symb,$udom,$uname)=@_;
     my $date;      my $date;
     my $interval= &Apache::lonnet::EXT("resource.$part_id.interval",$symb);      my $interval= &Apache::lonnet::EXT("resource.$part_id.interval",$symb,
          $udom,$uname);
     &Apache::lonxml::debug("looking for interval $part_id $symb $interval");      &Apache::lonxml::debug("looking for interval $part_id $symb $interval");
     my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb);      my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb,
          $udom,$uname);
     &Apache::lonxml::debug("looking for due_date $part_id $symb $due_date");      &Apache::lonxml::debug("looking for due_date $part_id $symb $due_date");
     if (defined($interval)) {      if (defined($interval)) {
  my $first_access=&Apache::lonnet::get_first_access('map',$symb);   my $first_access=&Apache::lonnet::get_first_access('map',$symb);

Removed from v.1.248  
changed lines
  Added in v.1.252


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