## WeBWorK Problems

### RationalExpEvaluator from College of Idaho

by Bruce Yoshiwara -
Number of replies: 2
I've been using "CofIdaho_macros.pl" for the "RationalExpEvaluator". I haven't learned yet how to find documentation, and specifically I'd like to know if it is possible to use the RationalExpEvaluator on an rational expression involving multiple variables. I tried without success simply adding a second variable in the argument, like RationalExpEvaluator($answer,"x", "y"), but no go. In reply to Bruce Yoshiwara ### Re: RationalExpEvaluator from College of Idaho by Robin Cruz - Hi, Bruce, I am guilty of writing the macro and I am planning to do some work on it this summer with better documentation -- one more week of classes to go!! You should be able to use more than one variable in an expression. Here is an example:$answer = "(x+$a*y)/(x-y)"; ANS(RationalExpEvaluator($answer,["x","y"]));

--rac

In reply to Robin Cruz

### Re: RationalExpEvaluator from College of Idaho

by Sean Fitzpatrick -
Hi Robin,

I know this is a very old post, but I came across it while searching for documentation on this macro. I was planning to include the following question on an assignment:

I usually experiment to see what will happen with different types of answers students might try. If they enter an answer such as (4x-3)/(5x^3-5x), all is well. However, if they factor the denominator in any way, such as (4x-3)/(5(x^3-x)) they get a big red error message with the following content:

The evaluated answer is not an answer hash : ||.

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself.

If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

Use of uninitialized value \$new_rh_ans_evaluation_result in concatenation (.) or string at /opt/webwork/pg/lib/WeBWorK/PG/Translator.pm line 1337

The behaviour I would expect for an answer like this is either to accept it as equivalent, or generate a message telling the students not to factor.

I've submitted this as Bug 3912. Do you have any suggestions on how to fix it?

Thanks, Sean