[system] / branches / gage_dev / pg / lib / Value / AnswerChecker.pm Repository:
ViewVC logotype

Diff of /branches/gage_dev/pg/lib/Value/AnswerChecker.pm

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

Revision 2603 Revision 2604
345# 345#
346sub cmp_postprocess { 346sub cmp_postprocess {
347 my $self = shift; my $ans = shift; 347 my $self = shift; my $ans = shift;
348 return unless $ans->{score} == 0 && !$ans->{isPreview}; 348 return unless $ans->{score} == 0 && !$ans->{isPreview};
349 my $other = $ans->{student_value}; 349 my $other = $ans->{student_value};
350 return unless $other->class eq 'Interval';
350 my @errors; 351 my @errors;
351 if ($ans->{showEndpointHints}) { 352 if ($ans->{showEndpointHints}) {
352 push(@errors,"Your left endpoint is incorrect") 353 push(@errors,"Your left endpoint is incorrect")
353 if ($self->{data}[0] != $other->{data}[0]); 354 if ($self->{data}[0] != $other->{data}[0]);
354 push(@errors,"Your right endpoint is incorrect") 355 push(@errors,"Your right endpoint is incorrect")
388 ordered => 0, 389 ordered => 0,
389 entry_type => undef, 390 entry_type => undef,
390 list_type => undef, 391 list_type => undef,
391 typeMatch => undef, 392 typeMatch => undef,
392 allowParens => 0, 393 allowParens => 0,
394 showParens => 0,
393}; 395};
394 396
395sub typeMatch {1} 397sub typeMatch {1}
398
399#
400# Handle removal of outermost parens in correct answer.
401#
402sub cmp {
403 my $self = shift;
404 my $cmp = $self->SUPER::cmp(@_);
405 if (!$cmp->{rh_ans}{showParens}) {
406 $self->{open} = $self->{close} = '';
407 $cmp->ans_hash(correct_ans => $self->stringify);
408 }
409 return $cmp;
410}
396 411
397sub cmp_equal { 412sub cmp_equal {
398 my $self = shift; my $ans = shift; 413 my $self = shift; my $ans = shift;
399 my $showPartialCorrectAnswers = $self->getPG('$showPartialCorrectAnswers'); 414 my $showPartialCorrectAnswers = $self->getPG('$showPartialCorrectAnswers');
400 my $showTypeWarnings = $ans->{showTypeWarnings}; 415 my $showTypeWarnings = $ans->{showTypeWarnings};

Legend:
Removed from v.2603  
changed lines
  Added in v.2604

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9