Difference between revisions of "AnswerHints"
Line 7: | Line 7: | ||
<br /> |
<br /> |
||
<br /> |
<br /> |
||
− | See also [http://webwork.maa.org/wiki/ErrorMessageCustomization ErrorMessageCustomization] and [http://webwork.maa.org/wiki/TextHints TextHints] |
||
+ | To provide hints that help students get started on a problem and made available after a student has submitted an answer at least once, see [http://webwork.maa.org/wiki/TextHints TextHints] |
||
+ | <br /> |
||
+ | Of related interest may be [http://webwork.maa.org/wiki/ErrorMessageCustomization ErrorMessageCustomization] |
||
</em> |
</em> |
||
</p> |
</p> |
Revision as of 22:21, 8 February 2010
Answer Hints
This PG code shows how to include customized answer hints in the messages box after a student submits a particular answer.
To provide hints that help students get started on a problem and made available after a student has submitted an answer at least once, see TextHints
Of related interest may be ErrorMessageCustomization
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "answerHints.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("Numeric"); Context()->variables->are(t=>"Real",u=>"Real"); $f = Formula("2 t"); $answer = Formula("6 u"); |
Setup:
We restrict the variables to only |
Context()->texStrings; BEGIN_TEXT If \( f(t) = $f \), then \( f(3u) \) = \{ ans_rule(10) \} END_TEXT Context()->normalStrings; |
Main Text: The problem text section of the file is as we'd expect. |
$showPartialCorrectAnswers = 1; ANS($answer->cmp() ->withPostFilter(AnswerHints( Formula("6 t") => "Are you using the correct variable?", Formula("6 u") => "Good work!", )) ); |
Answer Evaluation:
We use the |
- POD documentation: answerHints.pl
- PG macro code: answerHints.pl