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

Diff of /trunk/pg/lib/Value/AnswerChecker.pm

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

Revision 2616 Revision 2617
426 ($other->{close} eq ')' || $other->{close} eq ']') 426 ($other->{close} eq ')' || $other->{close} eq ']')
427 if $other->type =~ m/^(Point|List)$/; 427 if $other->type =~ m/^(Point|List)$/;
428 $other->type =~ m/^(Interval|Union)/; 428 $other->type =~ m/^(Interval|Union)/;
429} 429}
430 430
431#
432# Use the List checker for unions, in order to get
433# partial credit. Set the various types for error
434# messages.
435#
436sub cmp_defaults {(
437 Value::List->cmp_defaults,
438 typeMatch => Value::Interval->new("(1,2]"),
439 list_type => 'union',
440 entry_type => 'an interval',
441)}
442
443sub cmp_equal {Value::List::cmp_equal(@_)}
444
431############################################################# 445#############################################################
432 446
433package Value::List; 447package Value::List;
434 448
435sub cmp_defaults {( 449sub cmp_defaults {(
479 $showTypeWarnings = $showHints = $showLengthHints = 0 if $ans->{isPreview}; 493 $showTypeWarnings = $showHints = $showLengthHints = 0 if $ans->{isPreview};
480 494
481 my $student = $ans->{student_value}; 495 my $student = $ans->{student_value};
482 my @correct = $self->value; 496 my @correct = $self->value;
483 my @student = 497 my @student =
484 $student->class eq 'List' && 498 $student->class =~ m/^(List|Union)$/ &&
485 ($allowParens || (!$student->{open} && !$student->{close})) ? 499 ($allowParens || (!$student->{open} && !$student->{close})) ?
486 @{$student->{data}} : ($student); 500 @{$student->{data}} : ($student);
487 501
488 my $maxscore = scalar(@correct); 502 my $maxscore = scalar(@correct);
489 my $m = scalar(@student); 503 my $m = scalar(@student);

Legend:
Removed from v.2616  
changed lines
  Added in v.2617

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9