WeBWorK Main Forum

Webwork accepts answers, which are the same as problems

Webwork accepts answers, which are the same as problems

by Utku Demir -
Number of replies: 2
Hi,

While I was checking the problems I created, I realized that if I enter the answer as the same as the problem itself the submitted answer is accepted as correct. For example, if the question asks 1/(1+j) I expect students to enter 1/2 -j/2, but if they enter 1/(1+j) directly, it is accepted. Is there any way to prevent such thing? I thought that prompting real and imaginary parts separately but the operator Re() is a way to get around that. Any help would be appreciated.
In reply to Utku Demir

Re: Webwork accepts answers, which are the same as problems

by Andras Balogh -
You have to use contextLimitedComplex.pl to not accept complex formulas

http://webwork.maa.org/pod/pg_TRUNK/macros/contextLimitedComplex.pl.html
In reply to Utku Demir

Re: Webwork accepts answers, which are the same as problems

by Alex Jordan -
For this particular thing, you might just use the LimitedComplex context, or one of its variants: http://webwork.maa.org/pod/pg_TRUNK/macros/contextLimitedComplex.pl.html

There are other tools for distinguishing numerically equivalent answers that have different forms, but Limited Complex strikes me as the simplest for this.