| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.129 2004/05/14 22:03:54 toenail Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.130 2004/05/20 21:25:20 jj Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 556 | |
556 | |
| 557 | ##### answer processing ##### |
557 | ##### answer processing ##### |
| 558 | $WeBWorK::timer->continue("begin answer processing") if defined($WeBWorK::timer); |
558 | $WeBWorK::timer->continue("begin answer processing") if defined($WeBWorK::timer); |
| 559 | # if answers were submitted: |
559 | # if answers were submitted: |
| 560 | my $scoreRecordedMessage; |
560 | my $scoreRecordedMessage; |
|
|
561 | my $pureProblem; |
| 561 | if ($submitAnswers) { |
562 | if ($submitAnswers) { |
| 562 | # get a "pure" (unmerged) UserProblem to modify |
563 | # get a "pure" (unmerged) UserProblem to modify |
| 563 | # this will be undefined if the problem has not been assigned to this user |
564 | # this will be undefined if the problem has not been assigned to this user |
| 564 | my $pureProblem = $db->getUserProblem($problem->user_id, $problem->set_id, $problem->problem_id); # checked |
565 | $pureProblem = $db->getUserProblem($problem->user_id, $problem->set_id, $problem->problem_id); # checked |
| 565 | if (defined $pureProblem) { |
566 | if (defined $pureProblem) { |
| 566 | # store answers in DB for sticky answers |
567 | # store answers in DB for sticky answers |
| 567 | my %answersToStore; |
568 | my %answersToStore; |
| 568 | my %answerHash = %{ $pg->{answers} }; |
569 | my %answerHash = %{ $pg->{answers} }; |
| 569 | $answersToStore{$_} = $self->{formFields}->{$_} #$answerHash{$_}->{original_student_ans} -- this may have been modified for fields with multiple values. Don't use it!! |
570 | $answersToStore{$_} = $self->{formFields}->{$_} #$answerHash{$_}->{original_student_ans} -- this may have been modified for fields with multiple values. Don't use it!! |
| … | |
… | |
| 628 | } |
629 | } |
| 629 | |
630 | |
| 630 | # logging student answers |
631 | # logging student answers |
| 631 | |
632 | |
| 632 | my $answer_log = $self->{ce}->{courseFiles}->{logs}->{'answer_log'}; |
633 | my $answer_log = $self->{ce}->{courseFiles}->{logs}->{'answer_log'}; |
| 633 | if ( defined($answer_log )) { |
634 | if ( defined($answer_log ) and defined($pureProblem)) { |
| 634 | if ($submitAnswers ) { |
635 | if ($submitAnswers ) { |
| 635 | my $answerString = ""; |
636 | my $answerString = ""; |
| 636 | my %answerHash = %{ $pg->{answers} }; |
637 | my %answerHash = %{ $pg->{answers} }; |
| 637 | # FIXME this is the line 552 error. make sure original student ans is defined. |
638 | # FIXME this is the line 552 error. make sure original student ans is defined. |
| 638 | # The fact that it is not defined is probably due to an error in some answer evaluator. |
639 | # The fact that it is not defined is probably due to an error in some answer evaluator. |