[system] / trunk / pg / lib / AnswerHash.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/AnswerHash.pm

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

Revision 2059 Revision 2060
486 486
487sub get_student_answer { 487sub get_student_answer {
488 my $self = shift; 488 my $self = shift;
489 my $input = shift; 489 my $input = shift;
490 my %answer_options = @_; 490 my %answer_options = @_;
491 my $display_input = $input; 491 my $display_input = $input;
492 $display_input =~ s/\0/\\0/g; # make null spacings visible 492 $display_input =~ s/\0/\\0/g; # make null spacings visible
493 warn "Raw student answer is |$display_input|" if $self->{debug}; 493 warn "Raw student answer is |$display_input|" if $self->{debug};
494 $input = '' unless defined($input); 494 $input = '' unless defined($input);
495 if (ref($input) =~/AnswerHash/) { 495 if (ref($input) =~/AnswerHash/) {
496 # in this case nothing needs to be done, since the student's answer is already in an answerhash. 496 # in this case nothing needs to be done, since the student's answer is already in an answerhash.
525sub evaluate { 525sub evaluate {
526 my $self = shift; 526 my $self = shift;
527 $self->get_student_answer(@_); 527 $self->get_student_answer(@_);
528 $self->{rh_ans}->{error_flag}=undef; #reset the error flags in case 528 $self->{rh_ans}->{error_flag}=undef; #reset the error flags in case
529 $self->{rh_ans}->{done}=undef; #the answer evaluator is called twice 529 $self->{rh_ans}->{done}=undef; #the answer evaluator is called twice
530 my $rh_ans = $self ->{rh_ans}; 530 my $rh_ans = $self ->{rh_ans};
531 warn "<H3> Answer evaluator information: </H3>\n" if defined($self->{debug}) and $self->{debug}>0; 531 warn "<H3> Answer evaluator information: </H3>\n" if defined($self->{debug}) and $self->{debug}>0;
532 my @prefilters = @{$self -> {pre_filters}}; 532 my @prefilters = @{$self -> {pre_filters}};
533 my $count = -1; # the blank filter is counted as filter 0 533 my $count = -1; # the blank filter is counted as filter 0
534 foreach my $i (@prefilters) { 534 foreach my $i (@prefilters) {
535 last if defined( $self->{rh_ans}->{error_flag} ); 535 last if defined( $self->{rh_ans}->{error_flag} );

Legend:
Removed from v.2059  
changed lines
  Added in v.2060

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9