Skip to content

Commit

Permalink
Fix another regression caused by #609.
Browse files Browse the repository at this point in the history
If a problem sets the answer to be a formula with an assigment,
(something like `Formula("x = 5")` then all answers are counted
incorrect and a warning is displayed that the evaluated answer is not an
answer hash.  This worked prior to #609.  The cause of this was the
removal of a line that should not have been removed that converts the
other answer being compared to to a Formula if it is not already.

Note that the original issue that was attempted to be fixed by #609
still is fixed with this change.

This fixes issue #644 that I just submitted about this.
  • Loading branch information
drgrice1 committed Jan 29, 2022
1 parent 4400e4f commit 5b90c7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions macros/parserAssignment.pl
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ sub new {
sub typeMatch {
my $self = shift; my $other = shift; my $ans = shift;
return 0 unless $self->type eq $other->type;
$other = $other->Package("Formula")->new($self->context,$other) unless $other->isFormula;
my $typeMatch = $self->getTypicalValue($self)->{data}[1];
$other = $self->getTypicalValue($other,1)->{data}[1];
return 1 unless defined($other); # can't really tell, so don't report type mismatch
Expand Down

0 comments on commit 5b90c7f

Please sign in to comment.