## WeBWorK Problems

### Re: Author newbie: answer to be variable - 1

by Davide Cervone -
Number of replies: 0
Brian has given you the correct advice, but I thought I'd add two comments.

First, be sure to load the MathObjects.pl macros via

    loadMacros("MathObjects.pl");

at the top of your problem.

Second, if you don't want the correct answer to appear as $num-1 (e.g., if$num is 3, the correct answer will show as 3-1), then you can do either

    $new = Compute($num-1);

(with no quotation marks, so the subtraction is done first and THEN Compute() is called on the result), or
    $new = Real($num-1);

which creates a Real MathObject directly.

Good luck with your authoring.

Davide PS, if you are using the reply form to enter your message, you can enter <code&gt...&lt/code> directly, but if you are using the WYSIWYG editor, then you can't enter HTML directly (though you could probably select a monospace font). I have also been unhappy about no preview, but once you post you can continue to edit for 30 minutes, so that's almost like a preview.