[system] / trunk / pg / macros / PGbasicmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGbasicmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1964 Revision 2061
296 $tcol = $tcol < 40 ? $tcol : 40; ## get min 296 $tcol = $tcol < 40 ? $tcol : 40; ## get min
297 297
298 MODES( 298 MODES(
299 TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", 299 TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}",
300 Latex2HTML => qq!\\begin{rawhtml}<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\\end{rawhtml}!, 300 Latex2HTML => qq!\\begin{rawhtml}<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\\end{rawhtml}!,
301 HTML => "<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"$answer_value\">" 301 HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME="$name" VALUE = "$answer_value">\n
302 <INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">
303 !
304
302 ); 305 );
303} 306}
304 307
305sub NAMED_ANS_RULE_OPTION { # deprecated 308sub NAMED_ANS_RULE_OPTION { # deprecated
306 &NAMED_ANS_RULE_EXTENSION; 309 &NAMED_ANS_RULE_EXTENSION;
307} 310}
308 311
309sub NAMED_ANS_RULE_EXTENSION { 312sub NAMED_ANS_RULE_EXTENSION {
310 my($name,$col) = @_; 313 my($name,$col) = @_;
311 my $len = 0.07*$col; 314 my $len = 0.07*$col;
312 my $answer_value = ''; 315 my $answer_value = '';
313 $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name}); 316 $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name});
314 if ( defined( $rh_sticky_answers->{$name} ) ) { 317 if ( defined( $rh_sticky_answers->{$name} ) ) {
315 $answer_value = shift( @{ $rh_sticky_answers->{$name} }); 318 $answer_value = shift( @{ $rh_sticky_answers->{$name} });
316 $answer_value = '' unless defined($answer_value); 319 $answer_value = '' unless defined($answer_value);
317 } 320 }
318 $answer_value =~ tr/\\$@`//d; ## make sure student answers can not be interpolated by e.g. EV3 321 $answer_value =~ tr/\\$@`//d; ## make sure student answers can not be interpolated by e.g. EV3
319 MODES( 322 MODES(
320 TeX => '\\hrulefill\\quad ', 323 TeX => '\\hrulefill\\quad ',
321 Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!, 324 Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!,
322 HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME = "$name" VALUE = "$answer_value">\n! 325 HTML => qq!<INPUT TYPE=TEXT SIZE=$col NAME = "$name" VALUE = "$answer_value">\n
326 <INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">
327 !
323 ); 328 );
324} 329}
325 330
326sub ANS_RULE { #deprecated 331sub ANS_RULE { #deprecated
327 my($number,$col) = @_; 332 my($number,$col) = @_;
343 my $out = M3( 348 my $out = M3(
344 qq!\\vskip $height in \\hrulefill\\quad !, 349 qq!\\vskip $height in \\hrulefill\\quad !,
345 qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" 350 qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col"
346 WRAP="VIRTUAL">$answer_value</TEXTAREA>\\end{rawhtml}!, 351 WRAP="VIRTUAL">$answer_value</TEXTAREA>\\end{rawhtml}!,
347 qq!<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" 352 qq!<TEXTAREA NAME="$name" ROWS="$row" COLS="$col"
348 WRAP="VIRTUAL">$answer_value</TEXTAREA>! 353 WRAP="VIRTUAL">$answer_value</TEXTAREA>
354 <INPUT TYPE=HIDDEN NAME="previous_$name" VALUE = "$answer_value">
355 !
349 ); 356 );
350 $out; 357 $out;
351} 358}
352 359
353sub ANS_BOX { #deprecated 360sub ANS_BOX { #deprecated

Legend:
Removed from v.1964  
changed lines
  Added in v.2061

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9