Difference between revisions of "AnswerFormatHelp"

From WeBWorK_wiki
Jump to navigation Jump to search
(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...)
 
Line 76: Line 76:
 
<p>
 
<p>
 
<b>Main Text:</b>
 
<b>Main Text:</b>
 
  +
We use <code>AnswerFormatHelp("equations")</code> to generate a link to an html help file that reads <code>help (equations) </code>. The html help files are specifically designed to help students figure out the correct syntax for their answer, as well as common mistakes to avoid. Currently, help files are available for
  +
<ul>
  +
<li>angles</li>
  +
<li>decimals</li>
  +
<li>exponents</li>
  +
<li>formulas</li>
  +
<li>fractions</li>
  +
<li>inequalities</li>
  +
<li>intervals</li>
  +
<li>logarithms</li>
  +
<li>limits</li>
  +
<li>numbers</li>
  +
<li>points</li>
  +
<li>syntax</li>
  +
<li>units</li>
  +
<li>vectors</li>
  +
</ul>
  +
It is possible to change the link text by including a second argument to the routine:
  +
<pre>
  +
\{ AnswerFormatHelp("logarithms","click here for help entering logarithms") \}
  +
</pre>
 
</p>
 
</p>
 
</td>
 
</td>

Revision as of 23:46, 22 April 2010

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: We use AnswerFormatHelp("equations") to generate a link to an html help file that reads help (equations) . The html help files are specifically designed to help students figure out the correct syntax for their answer, as well as common mistakes to avoid. Currently, help files are available for

  • angles
  • decimals
  • exponents
  • formulas
  • fractions
  • inequalities
  • intervals
  • logarithms
  • limits
  • numbers
  • points
  • syntax
  • units
  • vectors

It is possible to change the link text by including a second argument to the routine:

\{ AnswerFormatHelp("logarithms","click here for help entering logarithms") \}

$showPartialCorrectAnswers = 1;

ANS( $answer->cmp() );

ENDDOCUMENT();

Answer Evaluation: As is the answer.

Problem Techniques Index