Just in case you are interested, there is a newer alternative way to give students re-randomized problems. It doesn't have quite the same functionality as problemRandomize.pl. In some ways it offers less, and in some ways more. But it doesn't involve PGcourse.pl; it just involves Course Configuration. You have to have WeBWorK 2.10 or newer, so maybe it's out of reach for you for now.
Some of the details here are outdated already, but the overall gist is still good:
And a video:
I've brought up a few times recently the possibility to run a script to see that every OPL problem loads PGcourse.pl. It would only be a problem if some people somewhere put nontrivial stuff in their PGcourse.pl, and for some problems in the OPL they have been assuming that PGcourse.pl is absent from the problem. But my own opinion is that to know that each and every OPL problem uses PGcourse.pl would be worth that risk. If there are instances of that issue, then the onus would be on those people to make a local copy that *removes* PGcourse.pl, or perhaps to write their PGcourse.pl in such a way that it can selectively not apply to some 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.plto 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.