cslmath / Champlain-Saint-Lambert-webwork-repo

A library of WeBWorK problems contributed by the Champlain Saint-Lambert math department
3 stars 4 forks source link

Location(s) of CPL macro files #34

Closed maharper closed 3 years ago

maharper commented 3 years ago

I think we should decide a location for local (CPL level local) macro files. I propose: champlain-problem-library/macros/.

When a problem requests a macro file like PGML.pl, or CPL-diagnostic.pl, or MH-contrib.pl, or just-for-this-problem.pl, WW looks for the macro file in directories, searching the directories in order until it finds a matching .pl file. The directory list is specified in defaults.config and can be overridden or added to in localOverrides.conf (system-wide impact) or in course.conf (only affects that specific course).

The default search order is (currently):

I would strongly recommend that we not override the default list as that would create problems when we upgrade WW. We can add to the list without creating those problems and I think we should add [TMPL]/champlainLibrary/macros to the bottom of the list in localOverrides.conf.

maharper commented 3 years ago

Other macro file locations

Very local

For function definitions that are very local, perhaps for only one problem or a small collection of problems local to a course, the .pl file can go in the same directory as the problem.

Course level

For function definitions to be used course-wide, but not shared further, macro files should go in the macros subdirectory of the course templates directory.

Contrib level

For function definition files that I am using in problems in my contrib directory, I see two possible locations:

  1. In a macros subdirectory the top level of my contrib directory, ie CPL-Contrib/MH-Contrib/macros/
  2. In a top level subdirectory of the contrib directory ie CPL-Contrib/macros/

Both locations have pros and cons.

maharper commented 3 years ago

CPL level macros:

Contrib level macros: