--- loncom/homework/grades.pm 2011/11/14 03:08:01 1.663 +++ loncom/homework/grades.pm 2011/11/30 23:24:49 1.665 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.663 2011/11/14 03:08:01 raeburn Exp $ +# $Id: grades.pm,v 1.665 2011/11/30 23:24:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -6909,7 +6909,7 @@ sub scantron_get_correction { .&mt('The ID on the form is [_1]', "$$scan_record{'scantron.ID'}") .'
' - .&mt('The name on the paper is [_2], [_3]', + .&mt('The name on the paper is [_1], [_2]', $$scan_record{'scantron.LastName'}, $$scan_record{'scantron.FirstName'}) .'

'; @@ -9388,23 +9388,25 @@ sub handler { } &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); +# see what command we need to execute + + my @commands=&Apache::loncommon::get_env_multiple('form.command'); + my $command=$commands[0]; + &init_perm(); if (!$env{'request.course.id'}) { - # Not in a course. - $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context"; - return HTTP_NOT_ACCEPTABLE; + unless ((&Apache::lonnet::allowed('usc',$env{'request.role.domain'})) && + ($command =~ /^scantronupload/)) { + # Not in a course. + $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context"; + return HTTP_NOT_ACCEPTABLE; + } } elsif (!%perm) { $request->internal_redirect('/adm/quickgrades'); } &Apache::loncommon::content_type($request,'text/html'); $request->send_http_header; - -# see what command we need to execute - - my @commands=&Apache::loncommon::get_env_multiple('form.command'); - my $command=$commands[0]; - if ($#commands > 0) { &Apache::lonnet::logthis("grades got multiple commands ".join(':',@commands)); }