OPL Maintenance

PGcourse.pl in OPL problems

PGcourse.pl in OPL problems

by Alex Jordan -
Number of replies: 3
Has any thought been given to insert 'PGcourse.pl' into all OPL problems? I imagine a script could run through them all, see if PGcourse.pl is not loaded, and if not, add it as the last argument of the last instance of loadMacros(). Or add it in its own loadMacros() after all others.

Is there be a known bad consequence to doing this, or would there be worry of unintended consequences?


In reply to Alex Jordan

Re: PGcourse.pl in OPL problems

by Michael Gage -
I have thought about it.  There is (always) some danger of unintended consequences ().  So for example someone who had something loaded into their PGcourse.pl macro in templates/macro might suddenly see changed behavior in some problems. 

I worry more about doing things automatically that make life easier 80% of the time but require gymnastics to disable for the other 20%.  Some have suggested loading PGcourse.pl automatically at the end of loadMacros whether it is present or not -- and I really suspect that is NOT a good idea because it is hard to reverse for those cases where PGcourse.pl should not be loaded. 

Your suggestion requires a little more work to implement but in those cases where having PGcourse.pl present causes difficulties it is fairly easy to  remove. One just hopes that those cases don't occur too often.  Unless someone sees downsides it's worth a try.  You can try it on your own library and use it for a month and then pull request it to the OPL. 

-- Mike

In reply to Alex Jordan

Re: PGcourse.pl in OPL problems

by Davide Cervone -
A long time ago, I wrote a script to help normalize WeBWorK problems. One of its actions was to normalize the loadMacros() calls. It does things like add PGstandard.pl and remove the files used in it, check for choice and graphics macros (which were in my original PGstandard, but were taken out when it was made official), and add PGcourse.pl at the bottom.

There are a number of other actions as well, so you would probably want to remove them. In particular, the removal of parentheses from TEXT(beginproblem()) is no longer correct (it was OK at the time, but changed in Perl have made it the wrong thing).

In any case, you can probably make use of this if you strip it down.

I've attached the script.

Davide
In reply to Alex Jordan

Re: PGcourse.pl in OPL problems

by Alex Jordan -
Mike and Davide, thanks! I'll eventually give the script a try. As you may know, my motivation here is to be able to rely on PGcourse.pl for the WeBWorK-MBX project. Our examples will be using the PCC server, so if I clean up problems there, it could make a difference.

We don't use very many OPL problems here. We've mostly written our own for basic algebra and basic math. For statistics and college algebra, it's a mix of having written our own, and having augmented problems from the OPL and then saved them in a separate local library. So if I run Davide's script, we probably won't be able to see very well if there were issues that arose.

Are OPL maintainers open to pulling a massive automated cleanup like this?