[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet Spreadsheet.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 23 Jan 2007 01:29:15 -0000
albertel Mon Jan 22 20:29:15 2007 EDT
Modified files:
/loncom/interface/spreadsheet Spreadsheet.pm
Log:
- uniqueify the list parms so they don't substituted multiple times
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.72 loncom/interface/spreadsheet/Spreadsheet.pm:1.73
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.72 Sat Sep 2 20:54:05 2006
+++ loncom/interface/spreadsheet/Spreadsheet.pm Mon Jan 22 20:29:15 2007
@@ -1,5 +1,5 @@
#
-# $Id: Spreadsheet.pm,v 1.72 2006/09/03 00:54:05 albertel Exp $
+# $Id: Spreadsheet.pm,v 1.73 2007/01/23 01:29:15 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -807,6 +807,8 @@
if ($expression=~/^\&/) {
my ($func,$var,$formula)=($expression=~/^\&(\w+)\(([^\;]+)\;(.*)\)/);
my @vars=split(/\W+/,$formula);
+ # make the list uniq
+ @vars = keys(%{{ map { $_ => 1 } @vars }});
my %values=();
foreach my $varname ( @vars ) {
if ($varname=~/^(parameter|stores|timestamp)/) {