PREP 2014 Question Authoring - Archived

Which macros to load (in general)?

Which macros to load (in general)?

by Aba Mbirika -
Number of replies: 1
In Davide's response to Joel Trussell below, he wrote "Note that this approach only works for problems that load PGcourse.pl. We encourage people to do that, but not everyone does, and there are lots of problems in the library that don't include this."

I have a few questions:
1) Is PGcourse.pl something that we should always put in our macros?

2) I am trying to learn from the OPL and see what others have in their 'preamble', and it seems like some have unneccessary and/or redundant macros loaded at times. For example, if PGstandard.pl is loaded, then that automatically loads "PG.pl, PGbasicmacros.pl, PGanswermacros.pl, and PGauxiliaryFunctions.pl", so there is no need to load any of those 4 macros if PGstandard.pl is loaded. But I see problems in the OPL that load PGstandard.pl AND some subset of the four other macros. And this is redundant. QUESTION: What is best practice in loading macros?

3) Gavin suggested yesterday that we use others as templates. But some things in the OPL, for instance, have BEGIN_PROBLEM ... END_PROBLEM in there so that is apparently old and unnecessary. Is there a way to know which problems in the OPL are "better templates" than others and hence better for us to mimic in our own authoring since the OPL has many older templates that may or may not 'teach' us the best practice?

Thanks for your thoughts,
aBa
In reply to Aba Mbirika

Re: Which macros to load (in general)?

by Paul Pearson -
Hi aBa,

You should probably always load PGstandard.pl and MathObjects.pl.  

I would strongly encourage you to load PGcourse.pl as the last macro, because with it you can do things like course-wide customization by adding some lines of code to the [coursename]/templates/macros/PGcourse.pl file (which you may have to create).

When I am updating an old problem in the OPL, I load PGstandard.pl and MathObjects.pl and then comment out all of the other macros that are loaded.  Then, using the Library Browser, I see if the PG file will run.  If the PG file does not run, I go back and start uncommenting macros until the PG file runs.  After a while, you get good at recognizing what features (e.g., graphing) go with which macros (e.g., PGgraphmacros.pl) and you develop a sense of what macros are likely needed to make a PG file work.  Also, pay attention to what code is being used in the PG file itself, since the code informs you which macros are going to be needed.

If you're looking for good templates in the Library, check out the FortLewis directory (which is written almost entirely by me) and should have good examples of everything except for PGML (which I only learned about last week!).  Gavin LaRose's problems in the Michigan directory are also great, but
I have noticed that, because they are a little older, they occasionally use old-style answer checkers.  There are probably other good places to look in the library (the Union directory comes to mind even though it is a bit older) that I know about as well as other good places to look in the library (John Travis's MC) that I have not yet explored.  I also recommend the Subject Area Templates and the Problem Techniques sections of the wiki:


N.B. The BEGIN_PROBLEM / END_PROBLEM stuff was just for Davide's fancy slides.

Best regards,

Paul Pearson