Difference between revisions of "AnswerFormatHelp"
m (7 revisions: import all default namespace pages from old wiki) |
|||
Line 93: | Line 93: | ||
<li>vectors</li> |
<li>vectors</li> |
||
</ul> |
</ul> |
||
+ | </p> |
||
+ | <p> |
||
It is possible to change the link text to <code>help entering equations</code> by including a second argument to the routine: |
It is possible to change the link text to <code>help entering equations</code> by including a second argument to the routine: |
||
<pre> |
<pre> |
||
\{ AnswerFormatHelp("equations","help entering equations") \} |
\{ AnswerFormatHelp("equations","help entering equations") \} |
||
+ | </pre> |
||
+ | </p> |
||
+ | <p> |
||
+ | It is possible to provide a link to an external file. We do not recommend this as it requires external files be maintained and links not become broken. Fields marked bogus are unused, but necessary, placeholders. |
||
+ | <pre> |
||
+ | \{ AnswerFormatHelp("bogus","help (formulas)","http://webwork.someschool.edu/dir/subdir/") \} |
||
+ | </pre> |
||
+ | </p> |
||
+ | <p> |
||
+ | It is possible to write your help document directly into the PG file as the fourth field to <code>AnswerFormatHelp</code>. This keeps the help documentation internal to the PG file and is therefore preferable to providing a link to an external file. |
||
+ | <pre> |
||
+ | \{ AnswerFormatHelp("bogus", |
||
+ | "custom help on formulas (internal source)", |
||
+ | "bogus", |
||
+ | "<h3> Help With Something</h3> |
||
+ | <ul> |
||
+ | <li><font color='#222255'>Header 1:</font> Some text with |
||
+ | some math <code>ln(x)</code><br /><br /></li> |
||
+ | <li><font color='#222255'>Header 2:</font> Some more text |
||
+ | with stuff below indented <blockquote>More text</blockquote> |
||
+ | <br /></br></li> |
||
+ | </ul> |
||
+ | <br /><br />") \} |
||
</pre> |
</pre> |
||
</p> |
</p> |
Revision as of 20:04, 5 January 2011
Answer Format Help Links
This PG code shows how to add answer format help links to problems.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "parserImplicitPlane.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("ImplicitPlane")->variables->are(x=>"Real",y=>"Real"); $answer = ImplicitPlane("x+y=2"); |
Setup:
By declaring there are only two variables, |
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
It is possible to change the link text to \{ AnswerFormatHelp("equations","help entering equations") \} It is possible to provide a link to an external file. We do not recommend this as it requires external files be maintained and links not become broken. Fields marked bogus are unused, but necessary, placeholders. \{ AnswerFormatHelp("bogus","help (formulas)","http://webwork.someschool.edu/dir/subdir/") \}
It is possible to write your help document directly into the PG file as the fourth field to \{ AnswerFormatHelp("bogus", "custom help on formulas (internal source)", "bogus", "<h3> Help With Something</h3> <ul> <li><font color='#222255'>Header 1:</font> Some text with some math <code>ln(x)</code><br /><br /></li> <li><font color='#222255'>Header 2:</font> Some more text with stuff below indented <blockquote>More text</blockquote> <br /></br></li> </ul> <br /><br />") \} |
$showPartialCorrectAnswers = 1; ANS( $answer->cmp() ); ENDDOCUMENT(); |
Answer Evaluation: |