I'm trying to capture two things in checking a student's answer to a particular type of question.
1. I want to allow "up to a constant" in the correct answer.
2. I want to catch a particular wrong answer and give a special message.
I've tried the following (simplified) approach:
[_]{$ans->cmp(upToConstant=>1)->withPostFilter(AnswerHints( Formula("x")=>"the message"))}
With the "upToConstant=>1" option, the correct answer + a constant is marked correct, but the answer "x" does not produce the answerhint message.
Without the "upToConstant=>1" option, the answerhint works to give the message, but the correct answer + a constant is now marked as incorrect.
Is there another way to achieve both goals? While it would be nice if "x + 2" also produced the answerhint message, I could live without that.