--- loncom/interface/spreadsheet/assesscalc.pm 2006/12/21 02:54:19 1.57 +++ loncom/interface/spreadsheet/assesscalc.pm 2014/02/11 19:11:30 1.60 @@ -1,5 +1,5 @@ # -# $Id: assesscalc.pm,v 1.57 2006/12/21 02:54:19 albertel Exp $ +# $Id: assesscalc.pm,v 1.60 2014/02/11 19:11:30 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,7 +156,7 @@ sub initialize { if (! defined($navmap)) { $navmap = Apache::lonnavmaps::navmap->new(); } - if (!defined($navmap)) { + if ((!defined($navmap)) || (!ref($navmap))) { &Apache::lonnet::logthis('assesscalc:Can not open Coursemap'); } &Apache::loncoursedata::clear_internal_caches(); @@ -488,19 +488,19 @@ END $r->print($tableheader); # # Print out template row - $r->print('Template '. + $r->print(''.&mt('Template').' '. $self->html_template_row($num_uneditable,$importcolor). "\n"); # # Print out summary/export row - $r->print('Export0'. + $r->print(''.&mt('Export').'0'. $self->html_export_row($exportcolor)."\n"); # # Prepare to output rows - $tableheader =<<"END"; - - -END + $tableheader = + '
rowItem
'. + ''. + ''; foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){ if ($label_num<$num_uneditable) { $tableheader.='
'.&mt('Row').''.&mt('Item').''; @@ -852,7 +852,7 @@ sub sett { # Replace 'A0' with the value from 'A0' $t{$cell}=~s/(^|[^\"\'])([A-Za-z]\d+)/$1\$sheet_values\{\'$2\'\}/g; # Replace parameters - $t{$cell}=~s/(^|[^\"\'])\[([^\]]+)\]/$1.$self->expandnamed($2)/ge; + $t{$cell}=~s/(^|[^\"\'])\[([^\]]+)\]/$1.$self->expandnamed($2)/sge; } } # @@ -871,7 +871,7 @@ sub sett { $t{$cell}=$formula; $t{$cell}=~s/\.\.+/\,/g; $t{$cell}=~s/(^|[^\"\'])([A-Za-z]\d+)/$1\$sheet_values\{\'$2\'\}/g; - $t{$cell}=~s/(^|[^\"\'])\[([^\]]+)\]/$1.$self->expandnamed($2)/ge; + $t{$cell}=~s/(^|[^\"\'])\[([^\]]+)\]/$1.$self->expandnamed($2)/sge; } } # Put %t into the safe space