[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 5174 Revision 5175
289 # store the rest -- beacuse this stores to a main:; variable 289 # store the rest -- beacuse this stores to a main:; variable
290 # it must be evaluated at run time 290 # it must be evaluated at run time
291 $answer_value= '' unless defined($answer_value); 291 $answer_value= '' unless defined($answer_value);
292 } 292 }
293 293
294 $answer_value =~ tr/\\$@`//d; ## make sure student answers can not be interpolated by e.g. EV3 294 $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3
295 $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer 295 $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer
296 $name = RECORD_ANS_NAME($name); 296 $name = RECORD_ANS_NAME($name);
297 297
298 my $tcol = $col/2 > 3 ? $col/2 : 3; ## get max 298 my $tcol = $col/2 > 3 ? $col/2 : 3; ## get max
299 $tcol = $tcol < 40 ? $tcol : 40; ## get min 299 $tcol = $tcol < 40 ? $tcol : 40; ## get min
316 $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name}); 316 $answer_value = ${$inputs_ref}{$name} if defined(${$inputs_ref}{$name});
317 if ( defined( $rh_sticky_answers->{$name} ) ) { 317 if ( defined( $rh_sticky_answers->{$name} ) ) {
318 $answer_value = shift( @{ $rh_sticky_answers->{$name} }); 318 $answer_value = shift( @{ $rh_sticky_answers->{$name} });
319 $answer_value = '' unless defined($answer_value); 319 $answer_value = '' unless defined($answer_value);
320 } 320 }
321 $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
322 $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer 322 $answer_value =~ s/\s+/ /g; ## remove excessive whitespace from student answer
323 my $tcol = $col/2 > 3 ? $col/2 : 3; ## get max 323 my $tcol = $col/2 > 3 ? $col/2 : 3; ## get max
324 $tcol = $tcol < 40 ? $tcol : 40; ## get min 324 $tcol = $tcol < 40 ? $tcol : 40; ## get min
325 MODES( 325 MODES(
326 TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}", 326 TeX => "\\mbox{\\parbox[t]{${tcol}ex}{\\hrulefill}}",
343 $col = 80 unless defined($col); 343 $col = 80 unless defined($col);
344 $name = RECORD_ANS_NAME($name); 344 $name = RECORD_ANS_NAME($name);
345 my $height = .07*$row; 345 my $height = .07*$row;
346 my $answer_value = ''; 346 my $answer_value = '';
347 $answer_value = $inputs_ref->{$name} if defined( $inputs_ref->{$name} ); 347 $answer_value = $inputs_ref->{$name} if defined( $inputs_ref->{$name} );
348 $answer_value =~ tr/\\$@`//d; ## make sure student answers can not be interpolated by e.g. EV3 348 $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3
349 my $out = M3( 349 my $out = M3(
350 qq!\\vskip $height in \\hrulefill\\quad !, 350 qq!\\vskip $height in \\hrulefill\\quad !,
351 qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" 351 qq!\\begin{rawhtml}<TEXTAREA NAME="$name" ROWS="$row" COLS="$col"
352 WRAP="VIRTUAL">$answer_value</TEXTAREA>\\end{rawhtml}!, 352 WRAP="VIRTUAL">$answer_value</TEXTAREA>\\end{rawhtml}!,
353 qq!<TEXTAREA NAME="$name" ROWS="$row" COLS="$col" 353 qq!<TEXTAREA NAME="$name" ROWS="$row" COLS="$col"
837 my @answers = @{ $answer_value}; 837 my @answers = @{ $answer_value};
838 $answer_value = shift(@answers); 838 $answer_value = shift(@answers);
839 $answer_value= '' unless defined($answer_value); 839 $answer_value= '' unless defined($answer_value);
840 } 840 }
841 841
842 $answer_value =~ tr/\\$@`//d; ## make sure student answers can not be interpolated by e.g. EV3 842 $answer_value =~ tr/\\$@`//d; #`## make sure student answers can not be interpolated by e.g. EV3
843 MODES( 843 MODES(
844 TeX => "\\mbox{\\parbox[t]{10pt}{\\hrulefill}}\\hrulefill\\quad ", 844 TeX => "\\mbox{\\parbox[t]{10pt}{\\hrulefill}}\\hrulefill\\quad ",
845 Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!, 845 Latex2HTML => qq!\\begin{rawhtml}\n<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"\">\n\\end{rawhtml}\n!,
846 HTML => "<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"$answer_value\">\n" 846 HTML => "<INPUT TYPE=TEXT SIZE=$col NAME=\"$name\" VALUE = \"$answer_value\">\n"
847 ); 847 );

Legend:
Removed from v.5174  
changed lines
  Added in v.5175

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9