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)";
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 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.
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?