WeBWorK Problems

Is it possible to disable the message "This answer is equivalent to the one you just submitted."

Is it possible to disable the message "This answer is equivalent to the one you just submitted."

by roo biki -
Number of replies: 2

Note: This question has already been answered here, and should be considered resolved.
https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4352

I'm writing a problem (attached) which asks a student to simplify an expression such as x^4/x^9.  The answer I want to see from students is 1/x^5.

I've done this with a custom answer checker that asks them to "simplify their answer" if the character 'x' appears in their answer more than once.

Everything seems to work fine, but there is one thing that bothers me -- if the student first enters x^4/x^9, their answer is marked incorrect and they receive the intended error message.  If they subsequently enter the correct answer of 1/x^5, their answer is marked correct, but they are given the message "This answer is equivalent to the one you just submitted."

While this is true, I would think this might confuse students -- it gives them mixed messages.

It seems that, as a general rule, if a student enters the same answer again but in a different form, WeBWorK likes to tell the student that the answers are equivalent.  But in this case I feel it is very unhelpful.  Is it possible to disable this behaviour for a particular question?

In reply to roo biki

Re: Is it possible to disable the message "This answer is equivalent to the one you just submitted."

by roo biki -
In reply to roo biki

Re: Is it possible to disable the message "This answer is equivalent to the one you just submitted."

by Glenn Rice -

Pass "bypass_equivalence_test => 1" to the cmp method for the answer.  That will skip the check that the previous answer and current answer are equivalent.  In your problem that would be

$ans = $ans->cmp(
    checker => sub {
        ...
    },
    bypass_equivalence_test => 1
);

Note that this will only work for webwork2 and pg version 2.16 or newer.