Forum archive 2000-2006

Nandor Sieben - Best way to store nonstandard macros?

Nandor Sieben - Best way to store nonstandard macros?

by Arnold Pizer -
Number of replies: 0
inactiveTopicBest way to store nonstandard macros? topic started 4/21/2005; 9:29:23 PM
last post 5/14/2005; 7:16:10 AM
userNandor Sieben - Best way to store nonstandard macros?  blueArrow
4/21/2005; 9:29:23 PM (reads: 1020, responses: 1)
I got all the problem libraries available by cvs. I store them in a read only directory. Each course has a symlink pointing to this directory. Some of the pg files require special macros. For example the union_problib has a macros directory containing about 40 macro files. Without these nonstandrad macro files the pg files are broken. What is the best way to make these macros available for the pg files? I don't want to put them into /opt/pg/macros where the standard macro files are. I'd rather keep them in a subdirectory of /opt/pg/macros, or use simlinks somehow, maybe in templates/macros. I'd like a solution where everything works after a cvs update on the problem libraries without any additional work. Would it be possible for the pg files to search the subdirectories of /opt/pg/macros for macro files?

Nandor

<| Post or View Comments |>


userDavide P. Cervone - Re: Best way to store nonstandard macros?  blueArrow
5/14/2005; 7:16:10 AM (reads: 1326, responses: 0)
Nandor:

There is no easy way to do what you ask with the way WeBWorK currently looks for macro files. I have just made a change to loadMacros(), however, that will make it possible to do what you want. You will need to update pg/macros/dangerousMacros.pl, ww2/conf/global.conf, ww2/lib/WeBWorK/PG.pl and ww2/lib/WeBWorK/PG/Local.pm to take advantage of the changes.

The new loadMacros() now looks through a list of directories that you can set in global.conf rather than just looking at the course templates/macros directory and the pg/macros directory. You can add as many directories as you like, so you can have one for the Union macros, and any other collections of macros that you would like to be included but don't want to move to pg/macros. The variable $pg{directories}{macrosPath} in global.conf is a reference to an array of directory names that are searched in the order given in the array. Add whatever new diretories you want (in the order you want).

Hope this does the trick.

Davide

<| Post or View Comments |>