--- loncom/interface/Attic/lonspreadsheet.pm 2002/12/05 15:31:05 1.155
+++ loncom/interface/Attic/lonspreadsheet.pm 2002/12/09 16:06:56 1.157
@@ -1,5 +1,5 @@
#
-# $Id: lonspreadsheet.pm,v 1.155 2002/12/05 15:31:05 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.157 2002/12/09 16:06:56 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1839,13 +1839,27 @@ sub readsheet {
}
%f=%{&parse_sheet(\$sheetxml)};
} else {
- my $sheet='';
my %tmphash = &Apache::lonnet::dump($fn,$cdom,$cnum);
my ($tmp) = keys(%tmphash);
- unless ($tmp =~ /^(con_lost|error|no_such_host)/i) {
+ if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
foreach (keys(%tmphash)) {
$f{$_}=$tmphash{$_};
}
+ } else {
+ # Unable to grab the specified spreadsheet,
+ # so we get the default ones instead.
+ $fn = 'default_'.$stype;
+ $sheet->{'filename'} = $fn;
+ my $dfn = $fn;
+ $dfn =~ s/\_/\./g;
+ my $sheetxml;
+ if (my $fh=Apache::File->new($includedir.'/'.$dfn)) {
+ $sheetxml = join('',<$fh>);
+ } else {
+ $sheetxml='
Cell '.$ENV{'form.unewfield'}.' =
'); $r->print(&HTML::Entities::encode($ENV{'form.unewformula'}). '');