--- loncom/homework/lonhomework.pm 2006/04/13 19:01:40 1.240 +++ loncom/homework/lonhomework.pm 2006/05/09 19:03:02 1.243 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.240 2006/04/13 19:01:40 albertel Exp $ +# $Id: lonhomework.pm,v 1.243 2006/05/09 19:03:02 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -234,7 +234,7 @@ sub check_slot_access { my ($status,$datemsg)=&check_access($id); my $useslots = &Apache::lonnet::EXT("resource.$id.useslots"); - if ($useslots ne 'resource') { + if ($useslots ne 'resource' && $useslots ne 'sequence') { return ($status,$datemsg); } @@ -266,6 +266,7 @@ sub check_slot_access { my $slotstatus='NOT_IN_A_SLOT'; my ($returned_slot,$slot_name); foreach my $slot (@slots) { + $slot =~ s/(^\s*|\s*$)//g; &Apache::lonxml::debug("getting $slot"); my %slot=&Apache::lonnet::get_slot($slot); &Apache::lonhomework::showhash(%slot); @@ -303,9 +304,10 @@ sub check_slot_access { &Apache::lonxml::debug(" slot is $slotstatus checkedin ($checkedin) got_grade ($got_grade) is_correct ($is_correct)"); - # has a current checked in recrd, but hasn't got a grade, must be awaiting - # a grade - if ($checkedin + # no slot is currently open, and has been checked in for this version + # but hasn't got a grade, therefore must be awaiting a grade + if (!defined($slot_name) + && $checkedin && !$got_grade) { return ('WAITING_FOR_GRADE'); }