WeBWorK Problems

Re: "Operands of '*' can't be words"

by Gavin LaRose -
Number of replies: 0
Hi Siman,

I think the problem is that there is an implied multiplication when you write -j: - is defined to be a string, and j similarly, but then -j isn't a separate string and so WeBWorK tries to multiply the two.

One solution would be to just include the -j (et al.) as strings:

Context()->strings->add(i=>{}, j=>{}, k=>{},
"-i"=>{}, "-j"=>{},
"-k"=>{});


Then I think the rest of the code will work, though there may be some less than perfect error messages (e.g., "Your second word is incorrect").

As a side note, PGstandard.pl loads PG.pl, PGbasicmacros.pl, PGanswerevaluators.pl, and PGauxiliaryFunctions.pl, so those don't need to be loaded as well as PGstandard.

Gavin