WeBWorK Problems

Getting correct feedback when a MathObject is entered when the correct answer is None

Getting correct feedback when a MathObject is entered when the correct answer is None

by Paul Seeburger -
Number of replies: 2
Ok, perhaps this question is answered somewhere in this forum, but I could not locate it.

A question asks for the coordinates of a point or to enter NONE if it does not exist. Context("Point") is used, but the answer is defined to be $ans = Compute("none"), just below it.

If the student enters "None" they are fine, but if they incorrectly enter the coordinates of a point, the feedback they are given is:
"Your answer isn't a number (it looks like a point)"

But this is crazy since they were asked to enter a point, and not a number. A number was not even an option.

I tried to add None as an answer to the Point context, but it gave me an error saying that string None already exists.

Any insights on this issue? It seems pretty common, so I must just be missing it in the documentation.

Thanks!

Paul
In reply to Paul Seeburger

Re: Getting correct feedback when a MathObject is entered when the correct answer is None

by Alex Jordan -
Hi Paul,

I think you will want the bit about "typeMatch" here:
http://webwork.maa.org/wiki/StringsInContext

Alex
In reply to Alex Jordan

Re: Getting correct feedback when a MathObject is entered when the correct answer is None

by Paul Seeburger -
Thanks, Alex!

That worked! I just had to use an example point in the formula shown in that wiki page.

Paul