CVS Access to Problem Libraries

From WeBWorK_wiki
Jump to navigation Jump to search

These instructions are for WeBWorK 2.3.0 and later.

What is a file-based problem library?

A file-based problem library is simply a directory structure containing PG and auxiliary files. The files are typically organized into subdirectories by topic. Set definition files may also be included, but this is not necessary.

Where can I obtain file-based problem libraries?

The WeBWorK project hosts CVS repositories which contain problem libraries. Refer to the Problem Libraries article for a list of problem libraries.

How can I download an entire problem library?

First, create a directory in your base webwork directory to hold libraries:

$ cd /opt/webwork
$ mkdir libraries

Then, change into that directory, and use cvs to check out the library:

$ cd libraries
$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/repository_name co module_name

Replace repository_name and module_name with values for the problem library you wish to check out. Each problem library on the Problem Libraries page lists the full cvs checkout command for that particular library.

What permissions should I use on problem library files?

Problem libraries should be readable by the web server. If you want professors to be able to edit the library versions of problems, you can make them writable as well. If you want to ensure that professors make a copy of a problem before editing it, make it non-writable.

How do I connect a problem library to an existing WeBWorK course?

Problem libraries are connected to courses by placing symlinks to the problem library in the course's templates directory.

First, add the problem library to the $courseFiles{problibs} hash in global.conf. The hash key is the name of the symlink in the templates directory, and the value is a human-readable name for the library. The names are used on the buttons in the Library Browser.

Second, create a symlink in the templates directory of each course you would like to connect to the problem library:

$ cd /opt/webwork/courses/myCourse/templates
$ ln -s /opt/webwork/libraries/rochester_problib rochester_problib

(Replace rochester_problib if you are linking to a different problem library.)

This can get tedious, so here's a shell script to create symlinks in every course:

for each in /opt/webwork/courses/*/templates
do ( cd $each; ln -s /opt/webwork/libraries/rochester_problib rochester_problib )
done

How can I pre-create these symlinks in new courses?

WeBWorK's Course Adminsitration feature allows you to copy templates from a model course when creating a new course. Any symlinks in the templates directory will be included in this copy. The default course to copy is modelCourse.

To have the symlinks included in new courses, add them to the templates directory of modelCourse (or whichever course you typically use).

How do I browse the problem libraries I've installed?

Log into a WeBWorK course and select Library Browser from the links menu. On the resulting screen, you should see lines of the form "or Problems from [ Foo ]" where "[ Foo ]" is a button with the name of a problem library. Click one of those buttons.

How can I update a problem library to the latest version?

Run the cvs update command to download the latest versions from our server. For example, this is how you would update the rochester_library.

$ cd /opt/webwork/libraries/rochester_problib
$ cvs -q update -dPA

How do I create a local problem library?

Problem libraries don't have to come from our CVS server. Simply create a new directory in /opt/webwork/libraries and add it to courses as described above. Any files you place in this directory are accessible from any course that's linked to it.

If you make this directory writable by the web server, professors can use it to exchange problems.

How do I tell the File Manager it's OK to navigate into my problem libraries?

Add /opt/webwork/libraries to the $webworkDirs{valid_symlinks} list in global.conf.