--- loncom/homework/grades.pm 2004/09/14 13:30:09 1.209 +++ loncom/homework/grades.pm 2004/09/29 05:46:11 1.218 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.209 2004/09/14 13:30:09 ng Exp $ +# $Id: grades.pm,v 1.218 2004/09/29 05:46:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,16 +25,6 @@ # # http://www.lon-capa.org/ # -# 2/9,2/13 Guy Albertelli -# 6/8 Gerd Kortemeyer -# 7/26 H.K. Ng -# 8/20 Gerd Kortemeyer -# Year 2002 -# June-August H.K. Ng -# Year 2003 -# February, March H.K. Ng -# July, H. K. Ng -# package Apache::grades; use strict; @@ -3855,7 +3845,8 @@ sub scantron_find_student { sub scantron_filter { my ($curres)=@_; - if (ref($curres) && $curres->is_problem() && !$curres->randomout) { + # randomout is dysfunctional at best for this purpose + if (ref($curres) && $curres->is_problem()) { #&& !$curres->randomout) { return 1; } return 0; @@ -4007,7 +3998,7 @@ sub scantron_form_start { - + @@ -4480,7 +4471,8 @@ sub scantron_validate_CODE { $line,'incorrectCODE',\%allcodes); return(1,$currentphase); } - if (exists($usedCODEs{$CODE}) && $ENV{'form.scantron_CODEunique'} + if (exists($usedCODEs{$CODE}) + && $ENV{'form.scantron_CODEunique'} eq 'yes' && !$$scan_record{'scantron.CODE_ignore_dup'}) { &scantron_get_correction($r,$i,$scan_record, \%scantron_config, @@ -4647,9 +4639,10 @@ SCANTRONFORM $form{'CODE'}=$scan_record->{'scantron.CODE'}; } my $result=&Apache::lonnet::ssi($resource->src(),%form); - + if (&Apache::loncommon::connection_aborted($r)) { last; } } $completedstudents{$uname}={'line'=>$line}; + if (&Apache::loncommon::connection_aborted($r)) { last; } } continue { &Apache::lonnet::delenv('form.counter'); &Apache::lonnet::delenv('scantron\.'); @@ -4719,7 +4712,8 @@ sub scantron_upload_scantron_data_save { } return ''; } -# $r->print("Doing upload to ".$ENV{'form.courseid'}."
"); + my %coursedata=&Apache::lonnet::coursedescription($ENV{'form.domainid'}.'_'.$ENV{'form.courseid'}); + $r->print("Doing upload to ".$coursedata{'description'}."
"); my $home=&Apache::lonnet::homeserver($ENV{'form.courseid'}, $ENV{'form.domainid'}); my $fname=$ENV{'form.upfile.filename'}; @@ -4742,17 +4736,14 @@ sub scantron_upload_scantron_data_save { $r->print("Error: The file you attempted to upload, ".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"').", contained no information. Please check that you entered the correct filename."); } else { my $result=&Apache::lonnet::finishuserfileupload($ENV{'form.courseid'},$ENV{'form.domainid'},$home,'upfile',$fname); -# if ($result =~ m|^/uploaded/|) { - if ($result !~ m|^/uploaded/|) { -# $r->print("Success: Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location ".$result.""); -# } else { + if ($result =~ m|^/uploaded/|) { + $r->print("Success: Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location ".$result.""); + } else { $r->print("Error: An error (".$result.") occurred when attempting to upload the file, ".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"').""); } } if ($symb) { -# $r->print(&show_grading_menu_form($symb,$url)); $r->print(&scantron_selectphase($r,$uploadedfile)); - } else { $r->print($doanotherupload); } @@ -5116,8 +5107,7 @@ sub send_header { sub send_footer { my ($request)= @_; - $request->print(''); - $request->print(&Apache::lontexconvert::footer()); + $request->print(''); } 1;