Category:PGML Answers

From WeBWorK_wiki
Revision as of 08:53, 13 May 2015 by Dpvc (talk | contribs) (Fix link to passing options to answer checkers)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Answer Checking in PGML[edit]

Answer blanks in PGML are indicated by [___________] where the number of underscores determines the width of the answer blank on screen. Usually, the answer is tied to the blank by enclosing it in braces following the answer blank. (If not, you will need to use ANS() outside the PGML code to provide an answer checker for the blank.) For example:

 $f = Formula("sin(x)+x^2");
 $Df = $f->D;
 If [:f(x) = [$f]:], then [:f'(x) = :] [______________________]{$Df}

produces a problem that displays a formula and asks for its derivative.

The answer you provide can be given in a variety of formats. It can be a number or a variable containing a number, a string that represents a MathObject to be used as the answer or a variable holding a MathObject, or a number of other possible values. These are described below.