I'd like to provide some feedback to students when certain wrong answers are selected in multiple choice questions. As an example, for a question asking for the first nonzero even number, provide a comment if "4" is selected. The code below is modeled on the "answerhints.pl" model (in a very amateurish way) and does not work. Help?
DOCUMENT();
loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"answerHints.pl",
"PGchoicemacros.pl"
);
#Multiple Choice
$radio = new_multiple_choice();
$radio->qa("What is the least nonzero even number","two");
$radio->extra("one","three","four");
$radio->makeLast("infinity");
TEXT(beginproblem());
BEGIN_TEXT
\{ $radio->print_q() \}
\{ $radio->print_a() \}
END_TEXT
ANS(radio_cmp($radio->correct_ans())->withPostFilter(AnswerHints("four"=>"Note you want the *least* nonzero even number")));
#ANS(radio_cmp($radio->correct_ans()) );
ENDDOCUMENT();