WeBWorK Problems

Code for perl functions

Code for perl functions

by Mike O'Sullivan -
Number of replies: 1
We have been writing problems for discrete mathematics and have created some functions in perl: e.g.
1) a factorization function
2) a function to get the exponents appearing in a factorization
3) the number of divisors function
4 set operation functions.
It is our understanding that these type of functions are not in the WebWork macros typically loaded at the beginning

We use the functions in several different problems, and don't want to have to include the code in all of them.

For our own purposes we can put the functions in a local directory and load them. But, if we create a library for others to use they may encounter difficulties setting up their own local directory for the perl code.

Any suggestions?

Mike O'Sullivan, Tom Schmidt

In reply to Mike O'Sullivan

Re: Code for perl functions

by Arnold Pizer -
Hi Mike and Tom,

If you look at 
you will see the directories

These contain macro files used in problems contributed by the named institutions.  Of course a problem using the macros has to load the necessary files(s).  In order for WeBWorK to find the files, in defaults.config you will see the code:

If you contribute your problems to the OPL, we could add your macros to the above.  If you want to set up you own server in a similar manner, I would suggest editing localOverrides.conf adding the above code from defaults.config plus whatever you call your new macros directory.