--- loncom/interface/slotrequest.pm 2005/11/21 21:20:06 1.35 +++ loncom/interface/slotrequest.pm 2005/11/21 22:16:24 1.36 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.35 2005/11/21 21:20:06 albertel Exp $ +# $Id: slotrequest.pm,v 1.36 2005/11/21 22:16:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1129,12 +1129,15 @@ sub handler { } else { my $symb=&Apache::lonnet::unescape($env{'form.symb'}); my (undef,undef,$res)=&Apache::lonnet::decode_symb($symb); - if ($res !~ /\.task$/) { + my $useslots = &Apache::lonnet::EXT("resource.0.useslots",$symb); + if ($useslots ne 'resource') { &fail($r,'not_valid'); return OK; } $env{'request.symb'}=$symb; - my ($status) = &Apache::lonhomework::check_task_access('0'); + my $type = ($res =~ /\.task$/) ? 'Task' + : 'problem'; + my ($status) = &Apache::lonhomework::check_slot_access('0',$type); if ($status eq 'CAN_ANSWER' || $status eq 'NEEDS_CHECKIN' || $status eq 'WAITING_FOR_GRADE') {