--- loncom/interface/spreadsheet/Spreadsheet.pm 2006/09/03 00:45:51 1.71 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2007/01/23 01:29:15 1.73 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.71 2006/09/03 00:45:51 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 @@ sub expandnamed { 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)/) { @@ -1891,7 +1893,7 @@ sub othersheets { $self->{'cdom'}, $self->{'cnum'}); my ($tmp) = keys(%results); if (%results - && $tmp =~ /^(con_lost|error|no_such_host)/i ) { + && $tmp !~ /^(con_lost|error|no_such_host)/i ) { push(@alternatives, sort(keys(%results))); } return @alternatives;