[system] / trunk / pg / macros / parserFormulaUpToConstant.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/parserFormulaUpToConstant.pl

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

Revision 5460 Revision 5461
189 return unless $ans->{score} == 0 && !$ans->{isPreview}; 189 return unless $ans->{score} == 0 && !$ans->{isPreview};
190 return if $ans->{ans_message} || !$self->getFlag("showHints"); 190 return if $ans->{ans_message} || !$self->getFlag("showHints");
191 my $student = $ans->{student_value}; 191 my $student = $ans->{student_value};
192 my $result = $ans->{correct_value} <=> $student; # compare encodes the reason in the result 192 my $result = $ans->{correct_value} <=> $student; # compare encodes the reason in the result
193 $self->cmp_Error($ans,"Note: there is always more than one posibility") if $result == 2 || $result == 3; 193 $self->cmp_Error($ans,"Note: there is always more than one posibility") if $result == 2 || $result == 3;
194 if ($result == 3) {
195 $self->context->flags->set(no_parameters=>0);
196 $result = 1 if $self->removeConstant+"n01+n00x" == $student+"x"; # must use both parameters
197 $self->context->flags->set(no_parameters=>1);
198 }
194 $self->cmp_Error($ans,"Your answer is not the most general solution") 199 $self->cmp_Error($ans,"Your answer is not the most general solution") if $result == 1;
195 if $result == 1 || ($result == 3 && $self->removeConstant == $student);
196 $self->cmp_Error($ans,"Your formula should be linear in the constant '$student->{constant}'") 200 $self->cmp_Error($ans,"Your formula should be linear in the constant '$student->{constant}'")
197 if $result == -1 && $self->getFlag("showLinearityHints") && !$student->D($student->{constant})->isConstant; 201 if $result == -1 && $self->getFlag("showLinearityHints") && !$student->D($student->{constant})->isConstant;
198} 202}
199 203
200################################################## 204##################################################

Legend:
Removed from v.5460  
changed lines
  Added in v.5461

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9