From: dpvc v. a. <we...@ma...> - 2008-06-27 00:56:43
|
Log Message: ----------- Fix EV3P to handle ${...} variable names. Tags: ---- rel-2-4-patches Modified Files: -------------- pg/macros: PGbasicmacros.pl Revision Data ------------- Index: PGbasicmacros.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/PGbasicmacros.pl,v retrieving revision 1.47.2.2.2.1 retrieving revision 1.47.2.2.2.2 diff -Lmacros/PGbasicmacros.pl -Lmacros/PGbasicmacros.pl -u -r1.47.2.2.2.1 -r1.47.2.2.2.2 --- macros/PGbasicmacros.pl +++ macros/PGbasicmacros.pl @@ -380,7 +380,7 @@ my $height = .07*$row; my $answer_value = ''; $answer_value = $inputs_ref->{$name} if defined( $inputs_ref->{$name} ); - $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 +# $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3 my $out = M3( qq!\\vskip $height in \\hrulefill\\quad !, qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" @@ -1230,10 +1230,10 @@ # The order of arguments is TeX, Latex2HTML, HTML # Adopted Davide Cervone's improvements to PAR, LTS, GTS, LTE, GTE, LBRACE, RBRACE, LB, RB. 7-14-03 AKP sub PAR { MODES( TeX => '\\par ', Latex2HTML => '\\begin{rawhtml}<P>\\end{rawhtml}', HTML => '<P>'); }; -sub BR { MODES( TeX => '\\par\\noindent ', Latex2HTML => '\\begin{rawhtml}<BR>\\end{rawhtml}', HTML => '<BR>'); }; +#sub BR { MODES( TeX => '\\par\\noindent ', Latex2HTML => '\\begin{rawhtml}<BR>\\end{rawhtml}', HTML => '<BR>'); }; # Alternate definition of BR which is slightly more flexible and gives more white space in printed output # which looks better but kills more trees. -#sub BR { MODES( TeX => '\\leavevmode\\\\', Latex2HTML => '\\begin{rawhtml}<BR>\\end{rawhtml}', HTML => '<BR>'); }; +sub BR { MODES( TeX => '\\leavevmode\\\\\\relax ', Latex2HTML => '\\begin{rawhtml}<BR>\\end{rawhtml}', HTML => '<BR>'); }; sub LQ { MODES( TeX => "``", Latex2HTML => '"', HTML => '"' ); }; sub RQ { MODES( TeX => "''", Latex2HTML => '"', HTML => '"' ); }; sub BM { MODES(TeX => '\\(', Latex2HTML => '\\(', HTML => ''); }; # begin math mode @@ -1677,7 +1677,7 @@ $string = ev_substring($string,"\\\\{","\\\\}",\&safe_ev) if $options{processCommands}; if ($options{processVariables}) { my $eval_string = $string; - $eval_string =~ s/\$(?![a-z])/\${DOLLAR}/gi if $options{fixDollars}; + $eval_string =~ s/\$(?![a-z\{])/\${DOLLAR}/gi if $options{fixDollars}; my ($evaluated_string,$PG_eval_errors,$PG_full_errors) = PG_restricted_eval("<<END_OF_EVALUATION_STRING\n$eval_string\nEND_OF_EVALUATION_STRING\n"); if ($PG_eval_errors) { |