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

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

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

Revision 1452 Revision 1455
2454# They provide a good model for how to tweak answer evaluators in special cases. 2454# They provide a good model for how to tweak answer evaluators in special cases.
2455 2455
2456sub anstext { 2456sub anstext {
2457 my $num = shift; 2457 my $num = shift;
2458 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS); 2458 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS);
2459 my $psvnNumber = PG_restricted_eval($main::psvnNumber); 2459 my $psvnNumber = PG_restricted_eval(q!$main::psvnNumber!);
2460 my $probNum = PG_restricted_eval($main::probNum); 2460 my $probNum = PG_restricted_eval(q!$main::probNum!);
2461 my $ans_eval = sub { 2461 my $ans_eval = sub {
2462 my $text = shift; 2462 my $text = shift;
2463 $text = '' unless defined($text); 2463 $text = '' unless defined($text);
2464 my $new_text = "\npsvnNumber-Problem-$probNum-Question-$num:\n $text "; # modify entered text 2464 my $new_text = "\npsvnNumber-Problem-$probNum-Question-$num:\n $text "; # modify entered text
2465 my $out = &$ans_eval_template($new_text); # standard evaluator 2465 my $out = &$ans_eval_template($new_text); # standard evaluator
2466 #warn "$QUESTIONNAIRE_ANSWERS"; 2466 #warn "$QUESTIONNAIRE_ANSWERS";
2470 $out; 2470 $out;
2471 }; 2471 };
2472 $ans_eval; 2472 $ans_eval;
2473} 2473}
2474 2474
2475
2475sub ansradio { 2476sub ansradio {
2476 my $num = shift; 2477 my $num = shift;
2477 my $psvnNumber = PG_restricted_eval($main::psvnNumber); 2478 my $psvnNumber = PG_restricted_eval(q!$main::psvnNumber!);
2478 my $probNum = PG_restricted_eval($main::probNum); 2479 my $probNum = PG_restricted_eval(q!$main::probNum!);
2479 2480
2480 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS); 2481 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS);
2481 my $ans_eval = sub { 2482 my $ans_eval = sub {
2482 my $text = shift; 2483 my $text = shift;
2483 $text = '' unless defined($text); 2484 $text = '' unless defined($text);
2492} 2493}
2493 2494
2494sub anstext_non_anonymous { 2495sub anstext_non_anonymous {
2495 ## this emails identifying information 2496 ## this emails identifying information
2496 my $num = shift; 2497 my $num = shift;
2497 my $psvnNumber = PG_restricted_eval($main::psvnNumber); 2498 my $psvnNumber = PG_restricted_eval(q!$main::psvnNumber!);
2498 my $probNum = PG_restricted_eval($main::probNum); 2499 my $probNum = PG_restricted_eval(q!$main::probNum!);
2499 my $studentLogin = PG_restricted_eval($main::studentLogin); 2500 my $studentLogin = PG_restricted_eval(q!$main::studentLogin!);
2500 my $studentID = PG_restricted_eval($main::studentID); 2501 my $studentID = PG_restricted_eval(q!$main::studentID!);
2501 my $studentName = PG_restricted_eval($main::studentName); 2502 my $studentName = PG_restricted_eval(q!$main::studentName!);
2502 2503
2503 2504
2504 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS); 2505 my $ans_eval_template = store_ans_at(\$QUESTIONNAIRE_ANSWERS);
2505 my $ans_eval = sub { 2506 my $ans_eval = sub {
2506 my $text = shift; 2507 my $text = shift;

Legend:
Removed from v.1452  
changed lines
  Added in v.1455

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9