--- loncom/interface/Attic/lonspreadsheet.pm 2002/11/21 19:05:18 1.146
+++ loncom/interface/Attic/lonspreadsheet.pm 2002/12/02 16:39:30 1.151
@@ -1,5 +1,5 @@
#
-# $Id: lonspreadsheet.pm,v 1.146 2002/11/21 19:05:18 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.151 2002/12/02 16:39:30 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -965,11 +965,9 @@ sub templaterow {
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z') {
- my $fm=$sheet->{'f'}->{'template_'.$_};
- $fm=~s/[\'\"]/\&\#34;/g;
push(@cols,{ name => 'template_'.$_,
- formula => $fm,
- value => $fm });
+ formula => $sheet->{'f'}->{'template_'.$_},
+ value => $sheet->{'f'}->{'template_'.$_} });
}
return ($rowlabel,@cols);
}
@@ -993,10 +991,8 @@ sub outrowassess {
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z') {
- my $fm=$sheet->{'f'}->{$_.$n};
- $fm=~s/[\'\"]/\&\#34;/g;
push(@cols,{ name => $_.$n,
- formula => $fm,
+ formula => $sheet->{'f'}->{$_.$n},
value => $sheet->{'values'}->{$_.$n}});
}
return ($rowlabel,@cols);
@@ -1019,10 +1015,8 @@ sub outrow {
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z') {
- my $fm=$sheet->{'f'}->{$_.$n};
- $fm=~s/[\'\"]/\&\#34;/g;
push(@cols,{ name => $_.$n,
- formula => $fm,
+ formula => $sheet->{'f'}->{$_.$n},
value => $sheet->{'values'}->{$_.$n}});
}
return ($rowlabel,@cols);
@@ -1257,9 +1251,17 @@ sub html_editable_cell {
if ($value =~ /^\s*$/ ) {
$value = '#';
}
+ &Apache::lonnet::logthis($name.' formula = '.$formula) if ($formula);
+ $formula =~ s/\</g;
+ $formula =~ s/>/\>/g;
+ $formula =~ s/\&/\&/g;
+ $formula =~ s/\"/\"/g;
+ $formula =~ s/\'/\"/g;
$formula =~ s/\n/\\n/gs;
- $result .= ''.$value.'';
+ &Apache::lonnet::logthis($name.' formula = '.$formula) if ($formula);
+ $result .= "".$value."";
+ &Apache::lonnet::logthis('result = '.$result) if ($formula);
return $result;
}
@@ -1317,7 +1319,7 @@ END
# Print out template row
####################################
my ($rowlabel,@rowdata) = &get_row($sheet,'-');
- my $row_html = '
'.&format_html_rowlabel($rowlabel).'
';
+ my $row_html = '
'.&format_html_rowlabel($sheet,$rowlabel).'
';
my $num_cols_output = 0;
foreach my $cell (@rowdata) {
if ($num_cols_output++ < $num_uneditable) {
@@ -1335,7 +1337,7 @@ END
# Print out summary/export row
####################################
my ($rowlabel,@rowdata) = &get_row($sheet,'0');
- $row_html = '
'.&format_html_rowlabel($rowlabel).'
';
+ $row_html = '
'.&format_html_rowlabel($sheet,$rowlabel).'
';
$num_cols_output = 0;
foreach my $cell (@rowdata) {
if ($num_cols_output++ < 26) {
@@ -1381,11 +1383,11 @@ END
'';
#
if ($sheet->{'sheettype'} eq 'classcalc') {
- $row_html.='
'.&format_html_rowlabel($rowlabel).'
';
+ $row_html.='
'.&format_html_rowlabel($sheet,$rowlabel).'
';
# Output links for each student?
# Nope, that is already done for us in format_html_rowlabel (for now)
} elsif ($sheet->{'sheettype'} eq 'studentcalc') {
- $row_html.='