I was wondering if there was an easy way to specify a short list of different correct answers for a single answer blank. The problem is as follows:

Students are asked to calculate the characteristic polynomial of a 3x3 matrix. Depending on how they are taught, some will answer det(A-xI) and some will answer det(xI-A), which differ by a factor of -1. I would like the system to accept either of these two answers, but nothing else.

Any suggestions?

$p = Formula("should do the trick.your formula here"); ... ANS($p->cmp(checker => sub { my ($correct,$student) = @_; return $correct == $student || $correct == -$student; });

Davide