WeBWorK Main Forum

possible to have "super macro" that loads all other macro files?

possible to have "super macro" that loads all other macro files?

by Christian Seberino -
Number of replies: 1

Possible to just put all macros I use in one file and then just load that one
file everywhere in every problem?

This would have the advantage that I could update all problems by just updating a single file.

cs
In reply to Christian Seberino

Re: possible to have "super macro" that loads all other macro files?

by Davide Cervone -
You can certainly include loadMacros() calls in a macro file (for example, the PGstandard.pl file is just a file that loads a bunch of other macro files).

Remember, however, that macro files have to be compiled every time the problem is viewed, and that means every time a student submits an answer as well, so loading extra macros files that aren't needed is inefficient and slows down the processing of every problem for every student.

It also makes it harder to share your problems, as you need to share your super-macro file as well.

For these reasons, I don't recommend including macros that aren't needed in the problem.