--- loncom/interface/Attic/lonspreadsheet.pm 2002/11/26 14:58:41 1.150 +++ loncom/interface/Attic/lonspreadsheet.pm 2002/12/02 16:39:30 1.151 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.150 2002/11/26 14:58:41 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/\n/\\n/gs; - $result .= ''.$value.''; + &Apache::lonnet::logthis($name.' formula = '.$formula) if ($formula); + $result .= "".$value.""; + &Apache::lonnet::logthis('result = '.$result) if ($formula); return $result; } @@ -2988,6 +2990,8 @@ sub handler { function celledit(cellname,cellformula) { var edit_text = ''; + // cellformula may contain less-than and greater-than symbols, so + // we need to escape them? edit_text +='Cell Edit Window'; edit_text += '
'; edit_text += '

Cell '+cellname+'

';