--- loncom/interface/lonprintout.pm 2008/09/21 21:25:21 1.536.2.1 +++ loncom/interface/lonprintout.pm 2008/09/23 12:00:05 1.536.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.536.2.1 2008/09/21 21:25:21 raeburn Exp $ +# $Id: lonprintout.pm,v 1.536.2.2 2008/09/23 12:00:05 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -385,8 +385,8 @@ sub is_valid_alpha_code { sub is_code_valid { my ($code_value, $code_option) = @_; my ($code_type, $code_length) = ('letter', 6); # defaults. - open(FG, $Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); - foreach my $line () { + my @lines = &Apache::grades::get_scantronformat_file(); + foreach my $line (@lines) { my ($name, $type, $length) = (split(/:/, $line))[0,2,4]; if($name eq $code_option) { $code_length = $length; @@ -1934,9 +1934,9 @@ ENDPART my $selected_code = $helper->{'VARS'}->{'CODE_SELECTED_FROM_LIST'}; my $code_option=$helper->{'VARS'}->{'CODE_OPTION'}; - open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); + my @lines = &Apache::grades::get_scantronformat_file(); my ($code_type,$code_length)=('letter',6); - foreach my $line () { + foreach my $line (@lines) { my ($name,$type,$length) = (split(/:/,$line))[0,2,4]; if ($name eq $code_option) { $code_length=$length; @@ -2854,10 +2854,9 @@ CHOOSE_STUDENTS } - - open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab'); + my @lines = &Apache::grades::get_scantronformat_file(); my $codechoice=''; - foreach my $line () { + foreach my $line (@lines) { my ($name,$description,$code_type,$code_length)= (split(/:/,$line))[0,1,2,4]; if ($code_length > 0 &&