WeBWorK Problems

Limiting operations allowed in formulas

Re: Limiting operations allowed in formulas

by Davide Cervone -
Number of replies: 0
What you are sking could be accomplished through a custom context, but I don't think there is one right now that will do what you want.

The only possibility I can think of at the moment is the LimitedPolynomial-Strict context defined in contextLimitedPolynomial.pl. This would do what you ask, but the error messages would probably not be what you want, as they would refer to polynomials. There is a message translation facility that could be used to convert the bad errors into more appropriate ones if you want to go that route.

The other approach would be to use a custom answer checker to first check if the two answers are equal, and then if they are, and then check the parse tree to make sure it does not include extra operations. This would be something like the checker I wrote for you in the discussion at:

http://wwrk.maa.org/moodle/mod/forum/discuss.php?d=356

Davide

P.S., I split this into a new discussion since it no longer is about the TF context that was the topic of the previous discussion.