Difference between revisions of "Category:PGML Answers"

From WeBWorK_wiki
Jump to navigation Jump to search
m (Removed a link that is covered in the first two items.)
m (Fix link to passing options to answer checkers)
 
Line 18: Line 18:
 
* [[Formula Answers - PGML|Formula Answers]]
 
* [[Formula Answers - PGML|Formula Answers]]
 
* [[MathObject Answers - PGML|MathObject Answers]]
 
* [[MathObject Answers - PGML|MathObject Answers]]
** [[MathObject Answers - PGML#Passing_Options_To_Answer_Checkers|Passing Options to Answer Checkers]]
+
** [[MathObject Answers - PGML#Passing_Options_to_Answer_Checkers|Passing Options to Answer Checkers]]
 
** [[MathObject Answers - PGML#Answer_Arrays|Answer Arrays]]
 
** [[MathObject Answers - PGML#Answer_Arrays|Answer Arrays]]
 
** [[MathObject Answers - PGML#MultiAnswer_Checkers|MultiAnswer Checkers]]
 
** [[MathObject Answers - PGML#MultiAnswer_Checkers|MultiAnswer Checkers]]

Latest revision as of 08:53, 13 May 2015

Answer Checking in PGML

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;
 
 BEGIN_PGML
 If [:f(x) = [$f]:], then [:f'(x) = :] [______________________]{$Df}
 END_PGML

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.

References