There actually is a terrible hack that you could do to get something that should work for all problems.
The idea is to tie into some other file that is called by all problems. PGbasicmacros.pl
is one such file. The way to do it would be to make a copy of PGbasicmacros.pl
and put it in your course templates/macros
folder, and then rename it as PGbasicmcros-orig.pl
. Then make a new file called PGbasicmacros.pl
and put the line
loadMacros("PGbasicmacros-orig.pl");
at the top pf the file. Then add whatever you would normally have put into
PGcourse.pl
to this new file.
As I said, it is a terrible hack, but can be useful in a pinch.
There are some files that are preloaded by WeBWorK (PG.pl
is one), and so those can't be used in this way, but I'm pretty sure PGbasicmacros.pl
isn't one of them.