Difference between revisions of "CVS Access to Problem Libraries"
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
− | This information is still located at http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/FileBasedProblemLibraries |
||
+ | 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 <code>webwork</code> directory to hold libraries: |
||
+ | |||
+ | $ cd /opt/webwork |
||
+ | $ mkdir libraries |
||
+ | |||
+ | Then, change into that directory, and use <code>cvs</code> to check out the library: |
||
+ | |||
+ | $ cd libraries |
||
+ | $ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/<b><i>repository_name</i></b> co <b><i>module_name</i></b> |
||
+ | |||
+ | 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 <code>cvs checkout</code> 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 <code>templates</code> directory. |
||
+ | |||
+ | First, add the problem library to the <code>$courseFiles{problibs}</code> hash in <code>global.conf</code>. The hash key is the name of the symlink in the <code>templates</code> 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 <code>rochester_problib</code> 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 <code>templates</code> directory will be included in this copy. The default course to copy is <code>modelCourse</code>. |
||
+ | |||
+ | To have the symlinks included in new courses, add them to the <code>templates</code> directory of <code>modelCourse</code> (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 <code>cvs update</code> command to download the latest versions from our server. For example, this is how you would update the <code>rochester_library</code>. |
||
+ | |||
+ | $ 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 <code>/opt/webwork/libraries</code> 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 <code>/opt/webwork/libraries</code> to the <code>$webworkDirs{valid_symlinks}</code> list in <code>global.conf</code>. |
||
[[Category:Problem Libraries]] |
[[Category:Problem Libraries]] |
Latest revision as of 17:36, 19 February 2008
These instructions are for WeBWorK 2.3.0 and later.
Contents
- 1 What is a file-based problem library?
- 2 Where can I obtain file-based problem libraries?
- 3 How can I download an entire problem library?
- 4 What permissions should I use on problem library files?
- 5 How do I connect a problem library to an existing WeBWorK course?
- 6 How can I pre-create these symlinks in new courses?
- 7 How do I browse the problem libraries I've installed?
- 8 How can I update a problem library to the latest version?
- 9 How do I create a local problem library?
- 10 How do I tell the File Manager it's OK to navigate into my problem libraries?
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.
Add /opt/webwork/libraries
to the $webworkDirs{valid_symlinks}
list in global.conf
.