[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet Spreadsheet.pm
raeburn
raeburn at source.lon-capa.org
Fri Aug 9 13:58:15 EDT 2013
raeburn Fri Aug 9 17:58:15 2013 EDT
Modified files:
/loncom/interface/spreadsheet Spreadsheet.pm
Log:
- Bug 6639
- cells previously populated, but now updated to contain nothing, are skipped
when cell contents are retrived using &get_values().
- Spreadsheet functions: &NUM(), &BIN(), &SUM(), &MEAN, &STDDEV(), &PROD()
&MAX(), &MIN(), &SUMMAX, &SUMMIN() all call &get_values().
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.81 loncom/interface/spreadsheet/Spreadsheet.pm:1.82
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.81 Wed Dec 16 13:00:53 2009
+++ loncom/interface/spreadsheet/Spreadsheet.pm Fri Aug 9 17:58:15 2013
@@ -1,5 +1,5 @@
#
-# $Id: Spreadsheet.pm,v 1.81 2009/12/16 13:00:53 bisitz Exp $
+# $Id: Spreadsheet.pm,v 1.82 2013/08/09 17:58:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -726,7 +726,7 @@
my @num=($ld..$ud);
foreach my $a (@alpha) {
foreach my $n (@num) {
- if (exists($sheet_values{$a.$n})) {
+ if ((exists($sheet_values{$a.$n})) && ($sheet_values{$a.$n} ne '')) {
push(@values,$sheet_values{$a.$n});
}
}
@@ -742,8 +742,10 @@
$alpha=qq/[$la-$ua]/;
}
my $expression = '^'.$alpha.$num.'$';
- foreach (grep /$expression/,keys(%sheet_values)) {
- push(@values,$sheet_values{$_});
+ foreach my $item (grep(/$expression/,keys(%sheet_values))) {
+ unless ($sheet_values{$item} eq '') {
+ push(@values,$sheet_values{$item});
+ }
}
return \@values;
}
More information about the LON-CAPA-cvs
mailing list