--- loncom/homework/grades.pm 2011/02/07 19:16:28 1.645 +++ loncom/homework/grades.pm 2011/05/27 14:39:50 1.648 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.645 2011/02/07 19:16:28 www Exp $ +# $Id: grades.pm,v 1.648 2011/05/27 14:39:50 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,7 +40,7 @@ use Apache::lonhomework; use Apache::lonpickcode; use Apache::loncoursedata; use Apache::lonmsg(); -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonlocal; use Apache::lonenc; use Apache::lonstathelpers; @@ -1512,7 +1512,7 @@ INNERJS var ypos = (screen.height-height)/2-30; ypos = (ypos < 0) ? '0' : ypos; - pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=600,height='+height); + pWin = window.open('', 'MessageCenter', 'resizable=yes,toolbar=no,location=no,scrollbars='+scrollbar+',screenx='+xpos+',screeny='+ypos+',width=700,height='+height); pWin.focus(); pDoc = pWin.document; pDoc.$docopen; @@ -7884,7 +7884,7 @@ sub scantron_upload_scantron_data { ')); $r->print(' -

'.&mt('Send scanned bubblesheet data to a course').'

+

'.&mt('Send bubblesheet data to a course').'

'.$default_form_data. @@ -8222,7 +8222,15 @@ sub checkscantron_results { } } } - $r->print('

'.&mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [quant,_1,student] ([_2] scantron lines/student).',$numstudents,$env{'form.scantron_maxbubble'}).'

'); + $r->print( + '

' + .&mt('Comparison of bubblesheet data (including corrections) with corresponding submission records (most recent submission) for [_1][quant,_2,student][_3] ([quant,_4,bubblesheet line] per student).', + '', + $numstudents, + '', + $env{'form.scantron_maxbubble'}) + .'

' + ); $r->print('

'.&mt('Exact matches for [quant,_1,student].',$passed).'
'.&mt('Discrepancies detected for [quant,_1,student].',$failed).'

'); if ($passed) { $r->print(&mt('Students with exact correspondence between bubblesheet data and submissions are as follows:').'

'); @@ -8477,7 +8485,7 @@ sub grading_menu { url => $url4, permission => 'F', icon => 'bubblesheet.png', - linktitle => 'Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.' + linktitle => 'Grade bubblesheet exams, upload/download bubblesheet data files, and review previously graded bubblesheet exams.' }, { linktext => 'Verify Receipt Number', url => $url5, @@ -9217,15 +9225,25 @@ sub select_problem { sub handler { my $request=$_[0]; &reset_caches(); - if ($env{'browser.mathml'}) { - &Apache::loncommon::content_type($request,'text/xml'); - } else { - &Apache::loncommon::content_type($request,'text/html'); + if ($request->header_only) { + &Apache::loncommon::content_type($request,'text/html'); + $request->send_http_header; + return OK; } - $request->send_http_header; - return '' if $request->header_only; &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}); + &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; + } 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'); @@ -9242,7 +9260,7 @@ sub handler { (my $url=$env{'form.url'}) =~ s-^https*://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--; $symb=&Apache::lonnet::symbread($url); } - &Apache::lonenc::check_decrypt(\$symb); + &Apache::lonenc::check_decrypt(\$symb); $ssi_error = 0; if (($symb eq '' || $command eq '') && ($env{'request.course.id'})) { @@ -9252,7 +9270,6 @@ sub handler { &startpage($request,undef,[],1,1); &select_problem($request); } else { - &init_perm(); if ($command eq 'submission' && $perm{'vgr'}) { &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]); ($env{'form.student'} eq '' ? &listStudents($request,$symb) : &submission($request,0,0,$symb)); @@ -9396,7 +9413,7 @@ sub handler { &Apache::lonquickgrades::endGradeScreen($request); $request->print(&Apache::loncommon::end_page()); &reset_caches(); - return ''; + return OK; } 1;