openwebwork/webwork2 — pull request #521 by Alex-Jordan (2014-12-11 08:21:39+00:00)
Title: Set defs search depth

Prior to this pull request, when importing `.def` files, only the `templates` folder (and no subfolder) are scanned for `.def` files. This adds `$options{setDefSearchDepth}=0;` and `$options{useOPLdefFiles}=0;` to `defaults.conf` which can be changed in `localOverrides.conf` or `course.conf`. `$options{setDefSearchDepth}` sets a search depth within subfolders (and symlinks) within `templates`. The idea is now you can store `.def` files in a subfolder of `templates` or in a central location on the server via a symlink.

Because this can take you into the OPL (where there are some `.def` files), you may want to exclude the OPL with `$options{useOPLdefFiles}`. (In fact every `.def` file I encountered in the OPL was broken with bad file paths and/or answer dates that came before the due date.)

I tested this with Hmwk Sets Editor2. When I went to test it with Hmwk Sets Editor, I had error warnings because of `.def` files that included a `description` line, and it appears Hmwk Sets Editor can't deal with that. Is this an oversight or are we not maintaining Hmwk Sets Editor anymore?

Test by restarting Apache, going to Hmwk Sets Editor2 in a course, and trying to import problem sets with various combinations of:
* different values for `$options{setDefSearchDepth}` and `$options{useOPLdefFiles}`. Setting the depth to 4 should make some OPL `.def` files appear. (But keep in mind that the OPL set.def files are probably not actually good if you then try to visit the set.) Also you might try putting some `.def` files in `templates` at depth 1 or 2.
* importing one or many sets.

And maybe do it with both Hmwk Sets Editor and Hmwk Sets Editor2.