##DESCRIPTION
##KEYWORDS()
## This is a questionaire regarding WeBWorK directed to students
## who have taken a class using WeBWorK
##ENDDESCRIPTION
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl"
);
## the following are useful short cuts whixh are uses a lot in the TEXT section below
$BL2H = MODES( Latex2HTML =>"\begin{rawhtml}", HTML => '', TeX => '');
$EL2H = MODES( Latex2HTML =>"\end{rawhtml}", HTML => '', TeX => '');
@button_string = ('%0' =>0,1=>1,2=>2,3=>3,4=>4,5=>5);
$recordSubmittedAnswers =0; ## do not record answers - this is an anonymous survey
TEXT($BL2H,$EL2H);
TEXT($BEGIN_ONE_COLUMN);
TEXT(&beginproblem);
$questionnaire_text = EV3(<<'END_TEXT');
$BR
$BCENTER
$BBOLD
SPRING 2006 WeBWorK EVALUATION
$EBOLD
$ECENTER
$BR $BR
Dear Students,
$BR $BR
We would very much appreciate your help in evaluating WeBWorK. We would like to hear
about both the strengths and weaknesses of WeBWorK as you see them and any
suggestions that you have for improving the program or the way it is used.
WeBWorK has already benefited from past comments by students and we want to
continue to improve it and make it as useful as possible as an educational tool.
$BR $BR Thank you very much for your time.
$BR $BR The WeBWorK Team $BR $BR P.S. You should know that this
questionnaire is not completely anonymous (most web browsing is not). With some
difficulty, submissions can in principle be traced back to their source. We
don't intend to trace the source of any comments, but we thought you should be
aware, if you weren't already, that no one is completely anonymous on the web.
$BR $BR Professors Gage and Pizer, WeBWorK developers.
$PAR
Please select the best choice for each question.
$PAR
$HR \{ $qn = 1; ''\}
A. What mathematics course are you currently enrolled in?
If you are in more than one, enter the one for which you are filling out this questionnaire.
$BR
\{ANS( anstext('A') ) ;
OL(
ans_radio_buttons(
1 => 'MTH 141A',
2 => 'MTH 141',
3 => 'MTH 142',
4 => 'MTH 143',
5 => 'MTH 150',
6 => 'MTH 161',
7 => 'MTH 162',
8 => 'MTH 163',
9 => 'MTH 164',
10 => 'MTH 165',
) );
\}
$PAR $HR
B. What is your gender?
(optional)
\{ANS( anstext('B') ) ;
OL(
ans_radio_buttons(
1 => 'Female',
2 => 'Male',
));
\}
$PAR $HR
C. Is this your first time taking this course?
\{ ANS(anstext('C') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
D. What was the most recent previous math course, if any, that you were enrolled in at this university?
$BR
\{ANS( anstext('D') ) ;
OL(
ans_radio_buttons(
1 => 'MTH 140A',
2 => 'MTH 141A',
3 => 'MTH 141',
4 => 'MTH 142',
5 => 'MTH 143',
6 => 'MTH 150',
7 => 'MTH 161',
8 => 'MTH 162',
9 => 'MTH 163',
10 => 'MTH 164',
11 => 'MTH 165',
12 => 'None',
0 => 'Other (please specify)',
));
\}
\{ ans_rule(20) \}
\{ ANS( anstext('D1') ) ; ''\}
$PAR $HR
E. What was the content of your most recent high school math course?
\{ANS( anstext('E') ) ;
OL(
ans_radio_buttons(
1 => 'Calculus',
2 => 'Pre-Calculus',
3 => 'Algebra',
4 => 'Geometry',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('E1') ); ans_rule(20) \}
$PAR $HR
F. What is your ethnicity?
(optional)
\{ANS( anstext('F') ) ;
OL(
ans_radio_buttons(
1 => 'Asian American/Pacific Islander',
2 => 'Black/African American',
3 => 'Caucasian/White',
4 => 'Latino/Hispanic American',
5 => 'Native American/Alaskan Native',
0 => 'Other (please specify)',
));
\}
\{ ans_rule(20) \}
\{ ANS( anstext('F1') ) ; ''\}
$PAR $HR
G. What is your academic status?
\{ANS( anstext('G') ) ;
OL(
ans_radio_buttons(
1 => 'Freshman',
2 => 'Sophomore',
3 => 'Junior',
4 => 'Senior',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('G1') ) ; ans_rule(20)\}
$PAR $HR
H. What is your intended major?
\{ANS( anstext('H') ) ;
OL(
ans_radio_buttons(
1 => 'Social Sciences (i.e. Psychology, Ecomonics, Political Science, History, etc.)',
2 => 'Humanities (i.e. English, Religion and Classics, Languages, etc.)',
3 => 'Natural Sciences (i.e. Physics, Chemistry, Biology, etc.)',
4 => 'Engineering',
5 => 'Mathematics or Computer Science',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('H1') ) ; ans_rule(40)\}
$PAR $HR
I. Do you plan to enroll in other mathematics courses at this university?
\{ANS( anstext('I') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
J. What grade do you expect to receive for this class?
\{ANS( anstext('J') ) ;
OL(
ans_radio_buttons(
1 => 'A',
2 => 'B',
3 => 'C',
4 => 'D',
5 => 'E',
));
\}
$PAR $HR
K. Approximately how many days before weekly due dates do you typically
begin to work on WeBWorK assignments?
\{ANS( anstext('K') ) ;
OL(
ans_radio_buttons(
1 => '1',
2 => '2',
3 => '3',
4 => '4',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('K1') ) ; ans_rule(20)\}
$PAR $HR
L. How many hours per week do you typically spend on WeBWorK problem sets?
\{ANS( anstext('L') ) ;
OL(
ans_radio_buttons(
1 => 'Less than 1 hour',
2 => '1 hour',
3 => '2 hours',
4 => '3 hours',
5 => 'More than 3 hours',
));
\}
$PAR $HR
M. How would you rank yourself as a mathematics student?
\{ANS( anstext('M') ) ;
OL(
ans_radio_buttons(
1 => 'Among the best',
2 => 'Above average',
3 => 'Average',
4 => 'Below average',
5 => 'Among the worst',
));
\}
$PAR $HR
N. Have you used WeBWorK in courses previous to this one?
\{ANS( anstext('N') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
O. Do you have access to a computer in your dorm room or residence?
\{ANS( anstext('O') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
P. Where do you typically work on WeBWorK problem sets?
\{ANS( anstext('P') ) ;
OL(
ans_radio_buttons(
1 => 'Your dorm room',
2 => 'Your off campus residence',
3 => 'A campus computing facility',
4 => 'The mathematics department',
5 => 'The library',
0 => 'Other (please specify)',
));
\}
\{ ANS(anstext('P1') ) ; ans_rule(20)\}
$PAR $HR
$PAR
Please rate the frequency with which you do each of the following:
$PAR
$BL2H
$EL2H
$PAR
$PAR
Please rate the extent to which you agree with each of the following statements:
$PAR
$BL2H
$EL2H
$PAR
$PAR
Please rate your satisfaction with each of the following:
$PAR
$BL2H
$EL2H
$PAR 28. Please tell us what you like about WeBWorK.$BR
\{ANS(anstext(28)); ans_box( 10,80) \}
$PAR 29. Please tell us what you do not like about WeBWorK$BR
\{ANS(anstext(29));ans_box(10,80 ) \}
$PAR 30. Please use this space for additional comments regarding WeBWorK$BR
\{ANS(anstext(30)); ans_box( 10,80) \}
$PAR
Thank you very much.
END_TEXT
TEXT(MODES( HTML => $questionnaire_text,
Latex2HTML => $questionnaire_text,
TeX => "Please answer the questionnaire on-line. Thank you."
));
TEXT($END_ONE_COLUMN);
sub mailing_problem_grader{
my $rh_evaluated_answers = shift;
my $rh_problem_state = shift;
my %form_options = @_;
my %evaluated_answers = %{$rh_evaluated_answers};
my %problem_state = %$rh_problem_state;
# %form_options might include
# The user login name
# The permission level of the user
# The studentLogin name for this psvn.
# Whether the form is asking for a refresh or is submitting a new answer.
# initial setup of the answer
my %problem_result = ( score => 0,
errors => '',
type => 'mailing_problem_grader',
msg => '',
);
# Checks
my $ansCount = keys %evaluated_answers; # get the number of answers
unless ($ansCount > 0 ) {
$problem_result{msg} = "This problem did not ask any questions.";
return(~~%problem_result,~~%problem_state);
}
my $allAnswersCorrectQ=1;
my $number_of_answers =0;
foreach my $ans_name (keys %evaluated_answers) {
# I'm not sure if this check is really useful.
if (ref($evaluated_answers{$ans_name} ) eq 'AnswerHash' ) { # changed HASH to AnswerHash dme 10/31/2000
$allAnswersCorrectQ = 0 unless( 1 == $evaluated_answers{$ans_name}->{score} );
$number_of_answers++ if $evaluated_answers{$ans_name}->{student_ans};
} else {
die "Error: Answer |$ans_name| is not a hash reference\n".
$evaluated_answers{$ans_name} .
"This probably means that the answer evaluator for this answer\n" .
"is not working correctly.";
$problem_result{error} = "Error: Answer $ans_name is not a hash: $evaluated_answers{$ans_name}";
}
}
# report the results
$problem_result{msg} = "";
$problem_result{score} = 1;
# I don't like to put in this bit of code.
# It makes it hard to construct error free problem graders
# I would prefer to know that the problem score was numeric.
unless ($problem_state{recorded_score} =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) {
$problem_state{recorded_score} = 0; # This gets rid of non-numeric scores
}
#
if ($allAnswersCorrectQ == 1 or $problem_state{recorded_score} == 1) {
$problem_state{recorded_score} = 1;
} else {
$problem_state{recorded_score} = 0;
}
if ($number_of_answers > 0) {
# mail_answers_to2('gage@math.rochester.edu','MTH 162 spring 2001 WeBWorK Questionnaire');
mail_answers_to2('apizer@math.rochester.edu','spring 2006 WeBWorK Questionnaire');
# mail_answers_to2('awda@troi.cc.rochester.edu','MTH 162 spring 2001 WeBWorK Questionnaire');
}
# You also have to modify the webworkCourse.ph file adding a line sililar to
# $PG_environment{'ALLOW_MAIL_TO'} = ['gage@math.rochester.edu','apizer@math.rochester.edu','awda@troi.cc.rochester.edu'];
# to enable email
$problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1;
$problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0;
(~~%problem_result, ~~%problem_state);
}
install_problem_grader(~~&mailing_problem_grader);
ENDDOCUMENT(); # This should be the last executable line in the problem. # this must be the last statement in any problem.
##KEYWORDS()
## This is a questionaire regarding WeBWorK directed to students
## who have taken a class using WeBWorK
##ENDDESCRIPTION
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl"
);
## the following are useful short cuts whixh are uses a lot in the TEXT section below
$BL2H = MODES( Latex2HTML =>"\begin{rawhtml}", HTML => '', TeX => '');
$EL2H = MODES( Latex2HTML =>"\end{rawhtml}", HTML => '', TeX => '');
@button_string = ('%0' =>0,1=>1,2=>2,3=>3,4=>4,5=>5);
$recordSubmittedAnswers =0; ## do not record answers - this is an anonymous survey
TEXT($BL2H,$EL2H);
TEXT($BEGIN_ONE_COLUMN);
TEXT(&beginproblem);
$questionnaire_text = EV3(<<'END_TEXT');
$BR
$BCENTER
$BBOLD
SPRING 2006 WeBWorK EVALUATION
$EBOLD
$ECENTER
$BR $BR
Dear Students,
$BR $BR
We would very much appreciate your help in evaluating WeBWorK. We would like to hear
about both the strengths and weaknesses of WeBWorK as you see them and any
suggestions that you have for improving the program or the way it is used.
WeBWorK has already benefited from past comments by students and we want to
continue to improve it and make it as useful as possible as an educational tool.
$BR $BR Thank you very much for your time.
$BR $BR The WeBWorK Team $BR $BR P.S. You should know that this
questionnaire is not completely anonymous (most web browsing is not). With some
difficulty, submissions can in principle be traced back to their source. We
don't intend to trace the source of any comments, but we thought you should be
aware, if you weren't already, that no one is completely anonymous on the web.
$BR $BR Professors Gage and Pizer, WeBWorK developers.
$PAR
Please select the best choice for each question.
$PAR
$HR \{ $qn = 1; ''\}
A. What mathematics course are you currently enrolled in?
If you are in more than one, enter the one for which you are filling out this questionnaire.
$BR
\{ANS( anstext('A') ) ;
OL(
ans_radio_buttons(
1 => 'MTH 141A',
2 => 'MTH 141',
3 => 'MTH 142',
4 => 'MTH 143',
5 => 'MTH 150',
6 => 'MTH 161',
7 => 'MTH 162',
8 => 'MTH 163',
9 => 'MTH 164',
10 => 'MTH 165',
) );
\}
$PAR $HR
B. What is your gender?
(optional)
\{ANS( anstext('B') ) ;
OL(
ans_radio_buttons(
1 => 'Female',
2 => 'Male',
));
\}
$PAR $HR
C. Is this your first time taking this course?
\{ ANS(anstext('C') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
D. What was the most recent previous math course, if any, that you were enrolled in at this university?
$BR
\{ANS( anstext('D') ) ;
OL(
ans_radio_buttons(
1 => 'MTH 140A',
2 => 'MTH 141A',
3 => 'MTH 141',
4 => 'MTH 142',
5 => 'MTH 143',
6 => 'MTH 150',
7 => 'MTH 161',
8 => 'MTH 162',
9 => 'MTH 163',
10 => 'MTH 164',
11 => 'MTH 165',
12 => 'None',
0 => 'Other (please specify)',
));
\}
\{ ans_rule(20) \}
\{ ANS( anstext('D1') ) ; ''\}
$PAR $HR
E. What was the content of your most recent high school math course?
\{ANS( anstext('E') ) ;
OL(
ans_radio_buttons(
1 => 'Calculus',
2 => 'Pre-Calculus',
3 => 'Algebra',
4 => 'Geometry',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('E1') ); ans_rule(20) \}
$PAR $HR
F. What is your ethnicity?
(optional)
\{ANS( anstext('F') ) ;
OL(
ans_radio_buttons(
1 => 'Asian American/Pacific Islander',
2 => 'Black/African American',
3 => 'Caucasian/White',
4 => 'Latino/Hispanic American',
5 => 'Native American/Alaskan Native',
0 => 'Other (please specify)',
));
\}
\{ ans_rule(20) \}
\{ ANS( anstext('F1') ) ; ''\}
$PAR $HR
G. What is your academic status?
\{ANS( anstext('G') ) ;
OL(
ans_radio_buttons(
1 => 'Freshman',
2 => 'Sophomore',
3 => 'Junior',
4 => 'Senior',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('G1') ) ; ans_rule(20)\}
$PAR $HR
H. What is your intended major?
\{ANS( anstext('H') ) ;
OL(
ans_radio_buttons(
1 => 'Social Sciences (i.e. Psychology, Ecomonics, Political Science, History, etc.)',
2 => 'Humanities (i.e. English, Religion and Classics, Languages, etc.)',
3 => 'Natural Sciences (i.e. Physics, Chemistry, Biology, etc.)',
4 => 'Engineering',
5 => 'Mathematics or Computer Science',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('H1') ) ; ans_rule(40)\}
$PAR $HR
I. Do you plan to enroll in other mathematics courses at this university?
\{ANS( anstext('I') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
J. What grade do you expect to receive for this class?
\{ANS( anstext('J') ) ;
OL(
ans_radio_buttons(
1 => 'A',
2 => 'B',
3 => 'C',
4 => 'D',
5 => 'E',
));
\}
$PAR $HR
K. Approximately how many days before weekly due dates do you typically
begin to work on WeBWorK assignments?
\{ANS( anstext('K') ) ;
OL(
ans_radio_buttons(
1 => '1',
2 => '2',
3 => '3',
4 => '4',
0 => 'Other (please specify)'
));
\}
\{ ANS(anstext('K1') ) ; ans_rule(20)\}
$PAR $HR
L. How many hours per week do you typically spend on WeBWorK problem sets?
\{ANS( anstext('L') ) ;
OL(
ans_radio_buttons(
1 => 'Less than 1 hour',
2 => '1 hour',
3 => '2 hours',
4 => '3 hours',
5 => 'More than 3 hours',
));
\}
$PAR $HR
M. How would you rank yourself as a mathematics student?
\{ANS( anstext('M') ) ;
OL(
ans_radio_buttons(
1 => 'Among the best',
2 => 'Above average',
3 => 'Average',
4 => 'Below average',
5 => 'Among the worst',
));
\}
$PAR $HR
N. Have you used WeBWorK in courses previous to this one?
\{ANS( anstext('N') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
O. Do you have access to a computer in your dorm room or residence?
\{ANS( anstext('O') ) ;
OL(
ans_radio_buttons(
1 => 'Yes',
2 => 'No',
));
\}
$PAR $HR
P. Where do you typically work on WeBWorK problem sets?
\{ANS( anstext('P') ) ;
OL(
ans_radio_buttons(
1 => 'Your dorm room',
2 => 'Your off campus residence',
3 => 'A campus computing facility',
4 => 'The mathematics department',
5 => 'The library',
0 => 'Other (please specify)',
));
\}
\{ ANS(anstext('P1') ) ; ans_rule(20)\}
$PAR $HR
$PAR
Please rate the frequency with which you do each of the following:
$PAR
$BL2H
Scale: 5 all the time, 4 almost all the time, 3 sometimes, 2 almost never, 1 never, 0 no answer | |
$EL2H \{ ANS( anstext(1) ); ans_radio_buttons(@button_string) \} $BL2H | 1. Use the email connection to get help with specific problems |
$EL2H \{ ANS(anstext(2) ); ans_radio_buttons( @button_string) \} $BL2H | 2. Do WeBWorK assignments with other students |
$EL2H \{ ANS(anstext(3) ); ans_radio_buttons( @button_string) \} $BL2H | 3. Get an entire assignment correct |
$EL2H \{ ANS(anstext(4) ); ans_radio_buttons( @button_string) \} $BL2H | 4. Seek help from your teaching assistant |
$EL2H \{ ANS(anstext(5) ); ans_radio_buttons( @button_string) \} $BL2H | 5. Seek help from your instructor |
$EL2H \{ ANS(anstext(6) ); ans_radio_buttons( @button_string) \} $BL2H | 6. Guess at problems you don't understand |
$EL2H \{ ANS(anstext(7) ); ans_radio_buttons( @button_string) \} $BL2H | 7. Get frustrated with and give up on a particular problem due to mathematical difficulty |
$EL2H \{ ANS(anstext(8) ); ans_radio_buttons( @button_string) \} $BL2H | 8. Get frustrated with the time it takes WeBWorK to respond to answers you submit to it |
$EL2H \{ ANS(anstext(9) ); ans_radio_buttons( @button_string) \} $BL2H | 9. Get frustrated with the syntactic requirements of answers you submit to WeBWorK |
$PAR
$PAR
Please rate the extent to which you agree with each of the following statements:
$PAR
$BL2H
5 strongly agree, 4 agree, 3 neutral, 2 disagree, 1 strongly disagree, 0 no answer | |
$EL2H \{ ANS( anstext(10) ); ans_radio_buttons(@button_string) \} $BL2H | 10. I prefer WeBWorK over paper and pencil homework |
$EL2H \{ ANS(anstext(11) ); ans_radio_buttons( @button_string) \} $BL2H | 11. WeBWorK forces me to keep up with the class material |
$EL2H \{ ANS(anstext(12) ); ans_radio_buttons( @button_string) \} $BL2H | 12. WeBWorK problems are challenging |
$EL2H \{ ANS(anstext(13) ); ans_radio_buttons( @button_string) \} $BL2H | 13. Class lectures effectively prepare me to complete WeBWorK assignments |
$EL2H \{ ANS(anstext(14) ); ans_radio_buttons( @button_string) \} $BL2H | 14. The content of WeBWorK problems is consistent with the material taught in lectures |
$EL2H \{ ANS(anstext(15) ); ans_radio_buttons( @button_string) \} $BL2H | 15. The content of WeBWorK problems is consistent with the material tested on exams |
$EL2H \{ ANS(anstext(16) ); ans_radio_buttons( @button_string) \} $BL2H | 16. WeBWorK effectively prepares me for course examinations |
$EL2H \{ ANS(anstext(17) ); ans_radio_buttons( @button_string) \} $BL2H | 17. The immediate responses I get from WeBWorK make me more persistent with assignments |
$EL2H \{ ANS(anstext(18) ); ans_radio_buttons( @button_string) \} $BL2H | 18. The immediate responses I get from WeBWorK help me learn the course material |
$EL2H \{ ANS(anstext(19) ); ans_radio_buttons( @button_string) \} $BL2H | 19. Email access to professors is a useful component of WeBWorK |
$EL2H \{ ANS(anstext(20) ); ans_radio_buttons( @button_string) \} $BL2H | 20. The Email feedback mechanism has made it easy to communicate with my professor |
$EL2H \{ ANS(anstext(21) ); ans_radio_buttons( @button_string)\} $BL2H | 21. I can successfully access WeBWorK whenever I need to |
$EL2H \{ ANS(anstext(22) ); ans_radio_buttons( @button_string)\} $BL2H | 22. I know where to go to get help when I am having trouble with course material or WeBWorK problems |
$EL2H \{ ANS(anstext(23) ); ans_radio_buttons( @button_string) \} $BL2H | 23. WeBWorK makes mathematics courses more enjoyable |
$PAR
$PAR
Please rate your satisfaction with each of the following:
$PAR
$BL2H
5 highly satisfied, 4 satisfied, 3 neutral, 2 dissatisfied, 1 strongly dissatisfied, 0 no answer | |
$EL2H \{ ANS( anstext(24) ); ans_radio_buttons(@button_string) \} $BL2H | 24. Your course instructor |
$EL2H \{ ANS(anstext(25) ); ans_radio_buttons( @button_string) \} $BL2H | 25. Your course TA |
$EL2H \{ ANS(anstext(26) ); ans_radio_buttons( @button_string) \} $BL2H | 26. Your course |
$EL2H \{ ANS(anstext(27) ); ans_radio_buttons( @button_string) \} $BL2H | 27. WeBWorK |
$EL2H
$PAR 28. Please tell us what you like about WeBWorK.$BR
\{ANS(anstext(28)); ans_box( 10,80) \}
$PAR 29. Please tell us what you do not like about WeBWorK$BR
\{ANS(anstext(29));ans_box(10,80 ) \}
$PAR 30. Please use this space for additional comments regarding WeBWorK$BR
\{ANS(anstext(30)); ans_box( 10,80) \}
$PAR
Thank you very much.
END_TEXT
TEXT(MODES( HTML => $questionnaire_text,
Latex2HTML => $questionnaire_text,
TeX => "Please answer the questionnaire on-line. Thank you."
));
TEXT($END_ONE_COLUMN);
sub mailing_problem_grader{
my $rh_evaluated_answers = shift;
my $rh_problem_state = shift;
my %form_options = @_;
my %evaluated_answers = %{$rh_evaluated_answers};
my %problem_state = %$rh_problem_state;
# %form_options might include
# The user login name
# The permission level of the user
# The studentLogin name for this psvn.
# Whether the form is asking for a refresh or is submitting a new answer.
# initial setup of the answer
my %problem_result = ( score => 0,
errors => '',
type => 'mailing_problem_grader',
msg => '',
);
# Checks
my $ansCount = keys %evaluated_answers; # get the number of answers
unless ($ansCount > 0 ) {
$problem_result{msg} = "This problem did not ask any questions.";
return(~~%problem_result,~~%problem_state);
}
my $allAnswersCorrectQ=1;
my $number_of_answers =0;
foreach my $ans_name (keys %evaluated_answers) {
# I'm not sure if this check is really useful.
if (ref($evaluated_answers{$ans_name} ) eq 'AnswerHash' ) { # changed HASH to AnswerHash dme 10/31/2000
$allAnswersCorrectQ = 0 unless( 1 == $evaluated_answers{$ans_name}->{score} );
$number_of_answers++ if $evaluated_answers{$ans_name}->{student_ans};
} else {
die "Error: Answer |$ans_name| is not a hash reference\n".
$evaluated_answers{$ans_name} .
"This probably means that the answer evaluator for this answer\n" .
"is not working correctly.";
$problem_result{error} = "Error: Answer $ans_name is not a hash: $evaluated_answers{$ans_name}";
}
}
# report the results
$problem_result{msg} = "";
$problem_result{score} = 1;
# I don't like to put in this bit of code.
# It makes it hard to construct error free problem graders
# I would prefer to know that the problem score was numeric.
unless ($problem_state{recorded_score} =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ) {
$problem_state{recorded_score} = 0; # This gets rid of non-numeric scores
}
#
if ($allAnswersCorrectQ == 1 or $problem_state{recorded_score} == 1) {
$problem_state{recorded_score} = 1;
} else {
$problem_state{recorded_score} = 0;
}
if ($number_of_answers > 0) {
# mail_answers_to2('gage@math.rochester.edu','MTH 162 spring 2001 WeBWorK Questionnaire');
mail_answers_to2('apizer@math.rochester.edu','spring 2006 WeBWorK Questionnaire');
# mail_answers_to2('awda@troi.cc.rochester.edu','MTH 162 spring 2001 WeBWorK Questionnaire');
}
# You also have to modify the webworkCourse.ph file adding a line sililar to
# $PG_environment{'ALLOW_MAIL_TO'} = ['gage@math.rochester.edu','apizer@math.rochester.edu','awda@troi.cc.rochester.edu'];
# to enable email
$problem_state{num_of_correct_ans}++ if $allAnswersCorrectQ == 1;
$problem_state{num_of_incorrect_ans}++ if $allAnswersCorrectQ == 0;
(~~%problem_result, ~~%problem_state);
}
install_problem_grader(~~&mailing_problem_grader);
ENDDOCUMENT(); # This should be the last executable line in the problem. # this must be the last statement in any problem.
Last modified: Saturday, 22 February 2020, 3:11 PM