Skip to content

Commit 5b90c7f

Browse files
committed
Fix another regression caused by #609.
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.
1 parent 4400e4f commit 5b90c7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

macros/parserAssignment.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ sub new {
357357
sub typeMatch {
358358
my $self = shift; my $other = shift; my $ans = shift;
359359
return 0 unless $self->type eq $other->type;
360+
$other = $other->Package("Formula")->new($self->context,$other) unless $other->isFormula;
360361
my $typeMatch = $self->getTypicalValue($self)->{data}[1];
361362
$other = $self->getTypicalValue($other,1)->{data}[1];
362363
return 1 unless defined($other); # can't really tell, so don't report type mismatch

0 commit comments

Comments
 (0)