AnswerFormatHelp

From WeBWorK_wiki
Revision as of 00:35, 23 April 2010 by Pearson (talk | contribs) (New page: <h2>Answer Format Help Links</h2> <!-- Header for these sections -- no modification needed --> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> <em>This PG cod...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Answer Format Help Links


This PG code shows how to add answer format help links to problems.

Problem Techniques Index

PG problem file Explanation
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"parserImplicitPlane.pl",
);
TEXT(beginproblem());

Initialization: We need to include the macros file AnswerFormatHelp.pl.

Context("ImplicitPlane")->variables->are(x=>"Real",y=>"Real");

$answer = ImplicitPlane("x+y=2");

Setup: By declaring there are only two variables, ImplicitPlane will address objects as lines rather than planes.

BEGIN_TEXT
Enter an equation for a line through the points
\( (0,2) \) and \( (2,0) \).
$BR
$BR
\{ ans_rule(20) \}
\{ AnswerFormatHelp("equations") \}
END_TEXT

Main Text:

$showPartialCorrectAnswers = 1;

ANS( $answer->cmp() );

ENDDOCUMENT();

Answer Evaluation: As is the answer.

Problem Techniques Index