WeBWorK Problems

multiple parts with hints

Re: multiple parts with hints

by Davide Cervone -
Number of replies: 0
Ken:

I'm not sure exactly what you are trying to accomplish. The answerHints.pl macros allow you to apply hints to a specific answer checker; it doesn't matter how many answers there are in the problem, not how many parts. Each answer checker could have its own hints applied to it.

If you mean you are using the MultiAnswer() object, then that is different, as you will be supplying an checker routine yourself, and you should issue hints via that routine (see the parserMultiAnswer.pl file for details).

As usual, sample code might make it clearer what you are hoping to do, as this description just isn't detailed enough for me to know what problem you are really having.

As far as I can tell, you should be able to use

    ANS($ans->cmp->withPostFilter(AnswerHints(...)));
for each answer in your multi-part problem. That should not cause any problems. Note that there are several ways to associate hints with incorrect answers, only one of which is to use a subroutine. You don't need to use that approach if you don't want to. The example in the answerHints.pl file includes an instance of each of the different types, but you don't have to use them all in your own answer hints.

Davide