--- loncom/homework/grades.pm 2008/04/21 16:30:47 1.518 +++ loncom/homework/grades.pm 2008/05/14 16:36:31 1.520 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.518 2008/04/21 16:30:47 raeburn Exp $ +# $Id: grades.pm,v 1.520 2008/05/14 16:36:31 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4908,7 +4908,7 @@ sub scantron_scantab { domainconfig user, lines are from this file. Otherwise, fall back to getting lines from the legacy file on the - local server: /home/httpd/lonTabs/scantronformat.tab + local server: /home/httpd/lonTabs/default_scantronformat.tab =cut @@ -4936,9 +4936,16 @@ sub get_scantronformat_file { } } if (!$gottab) { - my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); - @lines = <$fh>; - close($fh); + my @domains = &Apache::lonnet::current_machine_domains(); + if (grep(/^\Q$cdom\E$/,@domains)) { + my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); + @lines = <$fh>; + close($fh); + } else { + my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.'/default_scantronformat.tab'); + @lines = <$fh>; + close($fh); + } } return @lines; } @@ -7512,6 +7519,7 @@ SCANTRONFORM my @delayqueue; my %completedstudents; + my $lock=&Apache::lonnet::set_lock(&mt('Grading bubblesheet exam')); my $count=&get_todo_count($scanlines,$scan_data); my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Scantron Status', 'Scantron Progress',$count, @@ -7532,6 +7540,7 @@ SCANTRONFORM $r->print(""); &ssi_print_error($r); $r->print(&show_grading_menu_form($symb)); + &Apache::lonnet::remove_lock($lock); return ''; # Dunno why the other returns return '' rather than just returning. } @@ -7589,6 +7598,7 @@ SCANTRONFORM $r->print(""); &ssi_print_error($r); $r->print(&show_grading_menu_form($symb)); + &Apache::lonnet::remove_lock($lock); return ''; # Why return ''? Beats me. } @@ -7601,6 +7611,7 @@ SCANTRONFORM &Apache::lonnet::delenv('scantron\.'); } &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); + &Apache::lonnet::remove_lock($lock); # my $lasttime = &Time::HiRes::time()-$start; # $r->print("

took $lasttime

");