| … | |
… | |
| 345 | # |
345 | # |
| 346 | sub cmp_postprocess { |
346 | sub 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 | |
| 395 | sub typeMatch {1} |
397 | sub typeMatch {1} |
|
|
398 | |
|
|
399 | # |
|
|
400 | # Handle removal of outermost parens in correct answer. |
|
|
401 | # |
|
|
402 | sub 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 | |
| 397 | sub cmp_equal { |
412 | sub 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}; |