[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 2633 Revision 2634
75 if (defined $ans->{student_value}) { 75 if (defined $ans->{student_value}) {
76 $ans->{student_value} = Value::Formula->new($ans->{student_value}) 76 $ans->{student_value} = Value::Formula->new($ans->{student_value})
77 unless Value::isValue($ans->{student_value}); 77 unless Value::isValue($ans->{student_value});
78 $ans->{preview_latex_string} = $ans->{student_formula}->TeX; 78 $ans->{preview_latex_string} = $ans->{student_formula}->TeX;
79 $ans->{preview_text_string} = $ans->{student_formula}->string; 79 $ans->{preview_text_string} = $ans->{student_formula}->string;
80 $ans->{student_ans} = $ans->{student_value}->stringify; 80 $ans->{student_ans} = $ans->{preview_text_string};
81 $self->$cmp_equal($ans); 81 $self->$cmp_equal($ans);
82 $self->$cmp_postprocess($ans) if !$ans->{error_message}; 82 $self->$cmp_postprocess($ans) if !$ans->{error_message};
83 } else { 83 } else {
84 $self->$cmp_error($ans); 84 $self->$cmp_error($ans);
85 } 85 }
216 216
217package Value::Infinity; 217package Value::Infinity;
218 218
219sub cmp_class {'a Number'}; 219sub cmp_class {'a Number'};
220 220
221sub cmp_defaults {Value::Real->cmp_defaults};
222
223sub typeMatch { 221sub typeMatch {
224 my $self = shift; my $other = shift; my $ans = shift; 222 my $self = shift; my $other = shift; my $ans = shift;
225 return 1 unless ref($other); 223 return 1 unless ref($other);
226 return 0 if $other->class eq 'Formula'; 224 return 0 if $other->class eq 'Formula';
227 return 1 if $other->type eq 'Number'; 225 return 1 if $other->type eq 'Number';
433# messages. 431# messages.
434# 432#
435sub cmp_defaults {( 433sub cmp_defaults {(
436 Value::List::cmp_defaults(@_), 434 Value::List::cmp_defaults(@_),
437 typeMatch => 'Value::Interval', 435 typeMatch => 'Value::Interval',
438 list_type => 'a union', 436 list_type => 'an interval or union',
439 entry_type => 'an interval', 437 entry_type => 'an interval',
440)} 438)}
441 439
442sub cmp_equal {Value::List::cmp_equal(@_)} 440sub cmp_equal {Value::List::cmp_equal(@_)}
443 441

Legend:
Removed from v.2633  
changed lines
  Added in v.2634

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9