[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 1455 Revision 1456
2533 # then mail out all of the answers, including this last one. 2533 # then mail out all of the answers, including this last one.
2534 2534
2535 send_mail_to( $user_address, 2535 send_mail_to( $user_address,
2536 'subject' => "$main::courseName WeBWorK questionnaire", 2536 'subject' => "$main::courseName WeBWorK questionnaire",
2537 'body' => $QUESTIONNAIRE_ANSWERS, 2537 'body' => $QUESTIONNAIRE_ANSWERS,
2538 'ALLOW_MAIL_TO' => $rh_envir->{ALLOW_MAIL_TO} 2538 'ALLOW_MAIL_TO' => PG_restricted_eval(q!$main::rh_envir->{ALLOW_MAIL_TO}!)
2539 ); 2539 );
2540 2540
2541 my $ans_hash = new AnswerHash( 'score' => 1, 2541 my $ans_hash = new AnswerHash( 'score' => 1,
2542 'correct_ans' => '', 2542 'correct_ans' => '',
2543 'student_ans' => 'Answer recorded', 2543 'student_ans' => 'Answer recorded',
2546 ); 2546 );
2547 2547
2548 return $ans_hash; 2548 return $ans_hash;
2549 }; 2549 };
2550 2550
2551 return $ans_eval; 2551 return $ans_eval;
2552} 2552}
2553 2553
2554sub save_answer_to_file { #accepts the last answer and mails off the result 2554sub save_answer_to_file { #accepts the last answer and mails off the result
2555 my $fileID = shift; 2555 my $fileID = shift;
2556 my $ans_eval = new AnswerEvaluator; 2556 my $ans_eval = new AnswerEvaluator;
2580 2580
2581 return $ans_eval; 2581 return $ans_eval;
2582} 2582}
2583 2583
2584sub mail_answers_to2 { #accepts the last answer and mails off the result 2584sub mail_answers_to2 { #accepts the last answer and mails off the result
2585 my $user_address = shift; 2585 my $user_address = shift;
2586 my $subject = shift; 2586 my $subject = shift;
2587 my $ra_allow_mail_to = shift;
2587 $subject = "$main::courseName WeBWorK questionnaire" unless defined $subject; 2588 $subject = "$main::courseName WeBWorK questionnaire" unless defined $subject;
2588
2589 send_mail_to($user_address, 2589 send_mail_to($user_address,
2590 'subject' => $subject, 2590 'subject' => $subject,
2591 'body' => $QUESTIONNAIRE_ANSWERS, 2591 'body' => $QUESTIONNAIRE_ANSWERS,
2592 'ALLOW_MAIL_TO' => $rh_envir->{ALLOW_MAIL_TO} 2592 'ALLOW_MAIL_TO' => $ra_allow_mail_to,
2593 ); 2593 );
2594} 2594}
2595 2595
2596########################################################################## 2596##########################################################################
2597########################################################################## 2597##########################################################################
3815##################################### 3815#####################################
3816# This is a model for plug-in problem graders 3816# This is a model for plug-in problem graders
3817##################################### 3817#####################################
3818sub install_problem_grader { 3818sub install_problem_grader {
3819 my $rf_problem_grader = shift; 3819 my $rf_problem_grader = shift;
3820 PG_restricted_eval(q!$main::PG_FLAGS{PROBLEM_GRADER_TO_USE} = $rf_problem_grader!); 3820 my $rh_flags = PG_restricted_eval(q!\\%main::PG_FLAGS!);
3821 $rh_flags->{PROBLEM_GRADER_TO_USE} = $rf_problem_grader;
3821} 3822}
3822 3823
3823=head4 std_problem_grader 3824=head4 std_problem_grader
3824 3825
3825This is an all-or-nothing grader. A student must get all parts of the problem write 3826This is an all-or-nothing grader. A student must get all parts of the problem write

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9