--- loncom/homework/lonhomework.pm 2001/08/06 20:33:23 1.52 +++ loncom/homework/lonhomework.pm 2001/08/18 14:59:38 1.56 @@ -1,7 +1,7 @@ # The LON-CAPA Homework handler # Guy Albertelli # 11/30 Gerd Kortemeyer -# 6/1 Gerd Kortemeyer +# 6/1,8/17,8/18 Gerd Kortemeyer package Apache::lonhomework; use strict; @@ -84,7 +84,8 @@ sub send_footer { } $Apache::lonxml::browse=''; -sub check_date { + +sub check_access { my ($id) = @_; my $date =''; my $status = ''; @@ -130,6 +131,13 @@ sub check_date { if ( $maxtries eq '' ) { $maxtries = '2'; } if ($tries >= $maxtries) { $status = 'CANNOT_ANSWER'; } } + + if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') && + (!$Apache::lonhomework::history{"resource.0.outtoken"})) { + return ('UNCHECKEDOUT','needs to be checked out'); + } + + &Apache::lonxml::debug("sending back :$status:$datemsg:"); if (($Apache::lonhomework::browse eq 'F') && ($status eq 'CLOSED')) { &Apache::lonxml::debug("should be allowed to browse a resource when closed");