--- loncom/interface/slotrequest.pm 2005/11/21 21:20:06 1.35 +++ loncom/interface/slotrequest.pm 2005/12/14 22:26:10 1.37 @@ -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.37 2005/12/14 22:26:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -626,7 +626,7 @@ sub show_table { 'endtime' => 'End Time', 'startreserve' => 'Time students can start reserving', 'secret' => 'Secret Word', - 'maxspace' => 'Maxium # of students', + 'maxspace' => 'Maximum # of students', 'ip' => 'IP or DNS restrictions', 'symb' => 'Resource slot is restricted to.', 'uniqueperiod' => 'Period of time slot is unique', @@ -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') {