--- loncom/interface/Attic/lonspreadsheet.pm 2002/10/22 13:29:57 1.122
+++ loncom/interface/Attic/lonspreadsheet.pm 2002/10/24 15:30:25 1.126
@@ -1,5 +1,5 @@
#
-# $Id: lonspreadsheet.pm,v 1.122 2002/10/22 13:29:57 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.126 2002/10/24 15:30:25 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -122,20 +122,17 @@ my $tmpdir;
##
sub mask {
my ($lower,$upper)=@_;
-
- $lower=~/([A-Za-z]|\*)(\d+|\*)/;
- my $la=$1;
- my $ld=$2;
-
- $upper=~/([A-Za-z]|\*)(\d+|\*)/;
- my $ua=$1;
- my $ud=$2;
+ #
+ my ($la,$ld) = ($lower=~/([A-Za-z]|\*)(\d+|\*)/);
+ my ($ua,$ud) = ($upper=~/([A-Za-z]|\*)(\d+|\*)/);
+ #
my $alpha='';
my $num='';
-
+ #
if (($la eq '*') || ($ua eq '*')) {
$alpha='[A-Za-z]';
} else {
+
if (($la=~/[A-Z]/) && ($ua=~/[A-Z]/) ||
($la=~/[a-z]/) && ($ua=~/[a-z]/)) {
$alpha='['.$la.'-'.$ua.']';
@@ -188,8 +185,8 @@ sub mask {
}
$num.=')';
} else {
- if ($lda[$#lda]!=$uda[$#uda]) {
- $num.='['.$lda[$#lda].'-'.$uda[$#uda].']';
+ if ($lda[-1]!=$uda[-1]) {
+ $num.='['.$lda[-1].'-'.$uda[-1].']';
}
}
}
@@ -237,8 +234,6 @@ undef %c; # Holds the constants for a sh
# sheets, this is the A column. Used in &MINPARM, &MAXPARM, &expandnamed,
# &sett, and &setconstants. There is no &getconstants.
# &setconstants is called by &loadstudent, &loadcourse, &load assessment,
-undef %rowlabel; # Holds the 'prefix' for each row. Set by &setrowlabels.
- # &setrowlabels is called by &updateclasssheet, &updatestudentassesssheet,
undef @os; # Holds the names of other spreadsheets - this is used to specify
# the spreadsheets that are available for the assessment sheet.
# Set by &setothersheets. &setothersheets is called by &handler. A
@@ -979,7 +974,7 @@ sub outrowassess {
if ($n) {
my ($usy,$ufn)=split(/__&&&\__/,$sheet->{'f'}->{'A'.$n});
if ($sheet->{'rowlabel'}->{$usy}) {
- $cols[0]=$sheet->{'rowlabel'}->{$usy};
+ $cols[0]=&format_rowlabel($sheet->{'rowlabel'}->{$usy});
if (! $csv) {
$cols[0].=' '.
'