Difference between revisions of "PanicButton"
Jump to navigation
Jump to search
m (3 revisions: import all default namespace pages from old wiki) |
|||
(One intermediate revision by one other user not shown) | |||
Line 128: | Line 128: | ||
<ul> |
<ul> |
||
− | <li>POD documentation: [http://webwork.maa.org/ |
+ | <li>POD documentation: [http://webwork.maa.org/pod/pg/macros/problemPanic.html problemPanic.pl]</li> |
− | <li>PG macro: [http:// |
+ | <li>PG macro: [http://webwork.maa.org/viewvc/system/trunk/pg/macros/problemPanic.pl?view=log problemPanic.pl]</li> |
</ul> |
</ul> |
Latest revision as of 17:08, 7 April 2021
Panic Button for Answer Hints with a Penalty
This PG code shows how to implement a panic button for answer hints with a penalty.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "problemPanic.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("Numeric"); $answer = Real("sin(pi/3)"); |
Setup: Everything is standard |
BEGIN_TEXT \( \sin(\pi/3) \) = \{ ans_rule(10) \} $PAR \{ Panic::Button(label => "Request a Hint (25% Penalty)", penalty => .25) \} END_TEXT if ($panicked) { BEGIN_TEXT $PAR ${BBOLD}Hint:${EBOLD} The answer is greater than \( 1/2 \). $PAR \{Panic::Button(label => "Another Hint (25% Penalty)", penalty => .25)\} END_TEXT # if you want a secondary hint if ($panicked > 1) { BEGIN_TEXT ${BBOLD}Hint:${EBOLD} The answer is greater than \( \sqrt{2}/2 \). END_TEXT } } |
Main Text: We can construct a hint button that has a penalty associated with it. |
$showPartialCorrectAnswers = 1; # install_problem_grader(~~&avg_problem_grader); Panic::GradeWithPenalty(); ANS( $answer->cmp() ); ENDDOCUMENT(); |
Answer Evaluation:
We must issue the command |
- POD documentation: problemPanic.pl
- PG macro: problemPanic.pl