[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 23 Sep 2008 11:58:00 -0000
raeburn Tue Sep 23 07:58:00 2008 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Use &Apache::grades::get_scantronformat_file() to retrieve scantronformat file intead of reading from whatever file is on the server hosting the session.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.541 loncom/interface/lonprintout.pm:1.542
--- loncom/interface/lonprintout.pm:1.541 Mon Sep 15 22:45:21 2008
+++ loncom/interface/lonprintout.pm Tue Sep 23 07:57:58 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.541 2008/09/16 02:45:21 raeburn Exp $
+# $Id: lonprintout.pm,v 1.542 2008/09/23 11:57:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -392,8 +392,8 @@
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 (<FG>) {
+ 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;
@@ -1942,9 +1942,9 @@
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 (<FH>) {
+ foreach my $line (@lines) {
my ($name,$type,$length) = (split(/:/,$line))[0,2,4];
if ($name eq $code_option) {
$code_length=$length;
@@ -2860,10 +2860,9 @@
}
-
- open(FH,$Apache::lonnet::perlvar{'lonTabDir'}.'/scantronformat.tab');
+ my @lines = &Apache::grades::get_scantronformat_file();
my $codechoice='';
- foreach my $line (<FH>) {
+ foreach my $line (@lines) {
my ($name,$description,$code_type,$code_length)=
(split(/:/,$line))[0,1,2,4];
if ($code_length > 0 &&