[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 2686 Revision 2687
49 # Do some setup 49 # Do some setup
50 # 50 #
51 my $context = $$Value::context; # save it for later 51 my $context = $$Value::context; # save it for later
52 Parser::Context->current(undef,$self->{context}); # change to object's context 52 Parser::Context->current(undef,$self->{context}); # change to object's context
53 $context->flags->set(StringifyAsTeX => 0); # reset this, just in case. 53 $context->flags->set(StringifyAsTeX => 0); # reset this, just in case.
54 $context->flags->set(no_parameters => 1); # don't let students enter parameters
54 $ans->{isPreview} = $self->getPG('$inputs_ref->{previewAnswers}'); 55 $ans->{isPreview} = $self->getPG('$inputs_ref->{previewAnswers}');
55 $ans->{cmp_class} = $self->cmp_class($ans) unless $ans->{cmp_class}; 56 $ans->{cmp_class} = $self->cmp_class($ans) unless $ans->{cmp_class};
56 57
57 # 58 #
58 # Parse and evaluate the student answer 59 # Parse and evaluate the student answer
75 $self->cmp_equal($ans); 76 $self->cmp_equal($ans);
76 $self->cmp_postprocess($ans) if !$ans->{error_message}; 77 $self->cmp_postprocess($ans) if !$ans->{error_message};
77 } else { 78 } else {
78 $self->cmp_error($ans); 79 $self->cmp_error($ans);
79 } 80 }
81 $context->flags->set(no_parameters => 0); # let professors enter parameters
80 Parser::Context->current(undef,$context); # put back the old context 82 Parser::Context->current(undef,$context); # put back the old context
81 return $ans; 83 return $ans;
82} 84}
83 85
84# 86#

Legend:
Removed from v.2686  
changed lines
  Added in v.2687

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9