Now, I am not so picky, once they know what these functions are, and so I set about rewriting some of the problems to allow P(n,r) and C(n,r). However, I get stuck in one of two places.
Code similar to the following should work:
DOCUMENT();loadMacros("PG.pl","PGbasicmacros.pl","PGchoicemacros.pl","PGanswermacros.pl","contextIntegerFunctions.pl","PGauxiliaryFunctions.pl",);Context ("Numeric");Context () -> functions -> enable ('P');TEXT(beginproblem());$pi = Real("pi");Context()->texStrings;BEGIN_TEXTEnter a value for \(\pi\)\{ $pi -> ans_rule \}END_TEXTContext()->normalStrings;ANS($pi -> cmp);ENDDOCUMENT();
However, it doesn't. The WeBWorK documentation mentions the Context() line and gives examples where trig functions (and so on) are enabled or disabled. The Available Functions page mentioned the PGauxiliaryFunctions.pl file. In short, this should work.
I've tried various omissions, rearrangements, and so on. I either get a message that P is undefined, or I get the cryptic message:
which suggests that contextIntegerFunctions.pl needs to be rewritten.Can't locate object method "weaken" via package "main"
I've also checked online and in the Problem Library, and NO ONE has written a problem that allows the students to use the P and C functions. So that leads me here.
What's the fix?
--- Chris