WeBWorK Problems

Writing conditional hints, possible?

Re: Writing conditional hints, possible?

by Paul Pearson -
Number of replies: 0

In case you were wondering, there are two ways to install these macros.

1. Install them locally: only the course that has the macros in its course templates/macros directory will be able to use them. This method of installation can be done by instructors, and macros put into the templates/macros directory of a course will override any macros by the same name installed globally. To install a macro locally, log in to WeBWorK and click on "File Manager" and then double click the "macros" directory. This will put you in the "templates/macros" directory for the course. Then, click the "New File" button. When prompted for a file name, enter the name of the macro file you want to create, e.g. ConditionalHint.pl . Find the source code of the macro you would like to use on GitHub, e.g.,


Then, copy and paste the source code from GitHub into the file editor in WeBWorK and save the file (there should be a "Save" button at the bottom of the file editor within webwork). That's it -- the macro is installed locally and can be loaded by loadMacros(); just like any other macro file.

2. Install them globally: all courses on the server can use them. This will require system administrator privileges to accomplish. The macro files contributed to WeBWorK by individuals are in the OPL in the location OpenProblemLibrary/macros . I don't know off the top of my head if anything special (i.e., beyond the normal procedure for installing the OPL) is necessary to get the macros in this location working. Perhaps Jason Aubrey or someone else has a definitive answer.

Good luck!

Paul Pearson