--- loncom/homework/lonhomework.pm 2006/05/15 19:29:17 1.247 +++ loncom/homework/lonhomework.pm 2006/06/20 03:33:55 1.251 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.247 2006/05/15 19:29:17 albertel Exp $ +# $Id: lonhomework.pm,v 1.251 2006/06/20 03:33:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,6 +161,8 @@ sub proctor_checked_in { my ($slot_name,$slot,$type)=@_; my @possible_proctors=split(",",$slot->{'proctor'}); + return 1 if (!@possible_proctors); + my $key; if ($type eq 'Task') { my $version=$Apache::lonhomework::history{'resource.0.version'}; @@ -168,9 +170,14 @@ sub proctor_checked_in { } elsif ($type eq 'problem') { $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) { - if ($Apache::lonhomework::history{$key} eq $possible + if ($who eq $possible && $Apache::lonhomework::history{$key.'.slot'} eq $slot_name) { return 1; } @@ -238,7 +245,8 @@ sub check_slot_access { my ($status,$datemsg)=&check_access($id); my $useslots = &Apache::lonnet::EXT("resource.$id.useslots"); - if ($useslots ne 'resource' && $useslots ne 'map') { + if ($useslots ne 'resource' && $useslots ne 'map' + && $useslots ne 'map_map') { return ($status,$datemsg); } @@ -479,11 +487,13 @@ sub check_access { } # this should work exactly like the copy in lonnavmaps.pm sub due_date { - my ($part_id,$symb)=@_; + my ($part_id,$symb,$udom,$uname)=@_; 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"); - 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"); if (defined($interval)) { my $first_access=&Apache::lonnet::get_first_access('map',$symb);