Difference between revisions of "Overview of Problem Libraries"

From WeBWorK_wiki
Jump to navigation Jump to search
m (Reverted edits by Sam (Talk); changed back to last version by Jj)
Line 1: Line 1:
== Installation instructions for specific operating systems ==
 
  +
__TOC__
  +
=National Problem Library (NPL)=
   
These manuals offer command-by-command procedures (and fewer choices) than the general instructions. They are targeted at UNIX beginners.
 
  +
The National Problem Library contains problems from several of the File Based Problem Libraries, including all of the problems from the Arizona State, Rochester, Cal State Long Beach, University of Virginia libraries. It also contains most, if not all, of the problems from Union College, College of New Jersey, Dartmouth, Ohio State, Northern Arizona University, and Indiana University.
   
* [[Administrator's Guide/Installation/WW2.4/Ubuntu 7.04|WeBWorK 2.4 on Ubuntu 7.04]]
 
  +
In addition to merging these problem collections into a single collection, WeBWorK provides a different interface to these problems. Problems in the NPL are marked internally with meta-data, and instructors can search for problems on the basis of this data. This mechanism is built into WeBWorK's library browser. In particular, one can search hierarchically by course, chapter, section. To a limited extent, problems have been indexed against sections of textbooks in which case an instructor can also search for problems on that basis. WeBWorK stores this information in a database, so part of the installation involves loading meta-data into the database.
   
* [[Administrator's Guide/Installation/WW2.3/CentOS 5|WeBWorK 2.3 on CentOS 5]]
 
  +
<dl>
* [[Administrator's Guide/Installation/WW2.3/Debian 4.0|WeBWorK 2.3 on Debian 4.0]]
 
  +
<dt>Obtaining the NPL
* [[Administrator's Guide/Installation/WW2.3/Fedora Core 7|WeBWorK 2.3 on Fedora Core 4]]
 
  +
<dd>
* [[Administrator's Guide/Installation/WW2.3/SuSE 10.1|WeBWorK 2.3 on SuSE 10.1]]
 
  +
First, make sure you have an <code>/opt/webwork/libraries</code> directory:
* [[Administrator's Guide/Installation/WW2.3/SuSE 10.2|WeBWorK 2.3 on SuSE 10.2]]
 
  +
<pre>
* [[Administrator's Guide/Installation/WW2.3/Ubuntu 7.04|WeBWorK 2.3 on Ubuntu 7.04]]
 
  +
$ mkdir -p /opt/webwork/libraries
  +
</pre>
   
== Dependencies ==
 
  +
The database problem library can be downloaded from the ASU CVS repository.
  +
<pre>
  +
$ cd /opt/webwork/libraries
  +
$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/asu co database_problems
  +
</pre>
   
=== Apache ===
 
  +
If you are running WeBWorK 2.3.x, you must create a <code>ProblemLibrary</code> database on your MySQL server. (<strong>*</strong> represents the MySQL root password.)
  +
<pre>
  +
$ mysql -u root
  +
Password: *****
  +
&gt; CREATE DATABASE ProblemLibrary;
  +
&gt; GRANT SELECT on ProblemLibrary.* TO webworkWrite@localhost;
  +
&gt; quit
  +
Bye.
  +
$
  +
</pre>
   
WeBWorK supports Apache 1.3 and 2.0. Apache 2.2 is supported experimentally. WeBWorK requires that the <code>mod_alias</code> module be available. Most vendors compile their Apache packages with the necessary features enabled.
 
  +
If you are running WeBWorK 2.4.x, this is not necessary as the NPL indexes are stored within the main <code>webwork</code> database.
   
==== Apache 1.3 ====
 
  +
Configure WeBWorK to access the problem library. The settings are in <code>global.conf</code>:
   
* Source: http://httpd.apache.org/
 
  +
<strong><em>For WeBWorK 2.3.x:</em></strong>
* Debian/Ubuntu: <code>apache</code>
 
* Red Hat/Fedora: build from source
 
   
==== Apache 2.0 or 2.2 ====
 
  +
<table border="1" cellspacing="0" cellpadding="1"> <tr><th bgcolor="#99CCCC"> <strong>variable</strong> </th><th bgcolor="#99CCCC"> <strong>description</strong> </th></tr>
  +
<tr><td> <code>$problemLibrary{root}</code> </td><td> Path to <code>database_problems</code> directory. Should be <code>/opt/webwork/libraries/database_problems</code>. </td></tr>
   
Apache must be using the <code>prefork</code> MPM. This is because the <code>Safe</code> module, which WeBWorK makes extensive use of, is not threadsafe. This is set at compile time with the <code>--with-mpm=prefork</code> switch to the <code>configure</code> script.
 
  +
<tr><td> <code>$problemLibrary{version}</code> </td><td> Version of the problem library database. Should be <code>2</code>. </td></tr>
  +
<tr><td> <code>$problemLibrary{sourceSQL}</code> </td><td> Name of the database. Should be <code>ProblemLibrary</code>. </td></tr>
  +
<tr><td> <code>$problemLibrary{userSQL}</code> </td><td> Username to use when connecting to the database. Can usually be left as <code>$database_username</code>. </td></tr>
   
* Source: http://httpd.apache.org/
 
  +
<tr><td> <code>$problemLibrary{passwordSQL}</code> </td><td> Password to use when connecting to the database. Can usually be left as <code>$database_password</code>. </td></tr>
* Debian/Ubuntu: <code>apache2</code> with <code>apache2-mpm-prefork</code>
 
  +
</table>
* Red Hat/Fedora: build from source; or see below
 
   
''On my Scientific Linux 4 box (i.e., RHEL4) there is no need to recompile apache; mpm-prefork is already set. Of course mod_perl2 must be compiled!'' -- Niels Walet - 13 Mar 2007
 
   
=== Perl ===
 
  +
<strong><em>For WeBWorK 2.4.x</em></strong>
   
WeBWorK requires Perl 5.6.1 or higher.
 
  +
<table border="1" cellspacing="0" cellpadding="1"> <tr><th bgcolor="#99CCCC"> <strong>variable</strong> </th><th bgcolor="#99CCCC"> <strong>description</strong> </th></tr>
   
* Source: http://perl.org/
 
  +
<tr><td> <code>$problemLibrary{root}</code> </td><td> Path to <code>database_problems</code> directory. Should be <code>/opt/webwork/libraries/database_problems</code>. </td></tr>
* Debian/Ubuntu: <code>perl</code> (in the default install)
 
  +
<tr><td> <code>$problemLibrary{version}</code> </td><td> Version of the problem library database. Should be <code>2</code>. </td></tr>
* Red Hat/Fedora: <code>perl</code> (in the default install)
 
   
=== Perl modules ===
 
  +
<tr><td> <code>$problemLibrary_db{dbsource}</code> </td><td> Name of the database. Can usually be left as $database_dsn. </td></tr>
  +
<tr><td> <code>$problemLibrary_db{user}</code> </td><td> Username to use when connecting to the database. Can usually be left as <code>$database_username</code>. </td></tr>
  +
<tr><td> <code>$problemLibrary_db{passwd}</code> </td><td> Password to use when connecting to the database. Can usually be left as <code>$database_password</code>. </td></tr>
   
The following Perl modules are required. All are available from [http://cpan.org/ CPAN], and many vendors provide packages of these modules. To see if a module is installed on your system, use the following command. Replace <code>Module</code> with the name of the module.
 
  +
</table>
   
$ perl -MModule -e 'print "installed!\n"'
 
  +
Finally, populate the database:
   
To install a module from CPAN, use the following command as root. Replace <code>Module</code> with the name of the module.
 
  +
<strong><em>For WeBWorK 2.3.x:</em></strong>
   
# perl -MCPAN -e "install Module"
 
  +
Run the <code>loadDB2</code> script to populate the database. This script must be run from the <code>database_problems</code> directory.
  +
<pre>
  +
$ cd /opt/webwork/libraries/database_problems
  +
$ ./loadDB2
  +
What is the root password for mysql? *****
  +
Mysql database reinitialized
  +
Converting data from tagged pgfiles into mysql.
  +
$
  +
</pre>
   
For more information about using CPAN, consult the [http://cpan.org/misc/cpan-faq.html CPAN FAQ].
 
   
{| border="1"
 
  +
<strong><em>For WeBWorK 2.4.x:</em></strong>
|-
 
| '''module'''
 
| '''Debian/Ubuntu package'''
 
| '''Gentoo package'''
 
| '''Fedora Core 7 package'''
 
|-
 
| Apache::Request<br/><small>(only if using Apache 1.3.x)
 
| <code>libapache-request-perl</code>
 
|
 
|
 
|-
 
| Apache2::Request<br/><small>(only if using Apache 2.0.x)
 
| <code>libapache2-request-perl</code>
 
| <code>libapreq</code>
 
| <code>perl-libapreq2</code>
 
|-
 
| Data::UUID
 
| <code>libdata-uuid-perl</code> <br><small>(virtual package, provided by <code>libossp-uuid-perl</code>)</small>
 
| <code>Data-UUID</code>
 
| <code>perl-uuid</code>
 
|-
 
| Date::Format
 
| <code>libtimedate-perl</code>
 
| <code>TimeDate</code>
 
| <code>perl-TimeDate</code>
 
|-
 
| Date::Parse
 
| <code>libtimedate-perl</code>
 
| <code>TimeDate</code>
 
| <code>perl-TimeDate</code>
 
|-
 
| DateTime
 
| <code>libdatetime-perl</code>
 
| <code>DateTime</code>
 
| <code>perl-DateTime</code>
 
|-
 
| DBD::mysql
 
| <code>libdbd-mysql-perl</code>
 
| <code>DBD-mysql</code>
 
| <code>perl-DBD-MySQL</code>
 
|-
 
| Email::Address
 
| <code>libemail-address-perl</code>
 
| <code>Email-Address</code>
 
| <code>perl-Email-Address</code>
 
|-
 
| GD
 
| <code>libgd-gd2-perl</code>
 
| <code>GD</code>
 
| <code>perl-GD</code>
 
|-
 
| Iterator
 
| not packaged
 
| not packaged
 
| not packaged
 
|-
 
| Iterator::Util
 
| not packaged
 
| not packaged
 
| not packaged
 
|-
 
| Mail::Sender
 
| <code>libmail-sender-perl</code>
 
| <code>Mail-Sender</code>
 
| <code>perl-Mail-Sender</code>
 
|-
 
| SQL::Abstract
 
| <code>libsql-abstract-perl</code>
 
| unknown
 
| <code>perl-SQL-Abstract</code>
 
|-
 
| String::ShellQuote
 
| <code>libstring-shellquote-perl</code>
 
| <code>String-ShellQuote</code>
 
| <code>perl-String-ShellQuote</code>
 
|-
 
| Time::HiRes<br><small>(included in Perl 5.8 and higher)</small>
 
| included in <code>perl</code> package
 
| unknown
 
| included in <code>perl</code> package
 
|-
 
| XML::Parser
 
| <code>libxml-parser-perl</code>
 
| <code>libxml-perl</code>
 
| <code>perl-XML-Parser</code>
 
|-
 
| XML::Parser::EasyTree
 
| not packaged
 
| unknown
 
| not packaged
 
|-
 
| XML::Writer
 
| <code>libxml-writer-perl</code>
 
| <code>XML-Writer</code>
 
| <code>perl-XML-Writer</code>
 
|}
 
   
==== DateTime::TimeZone: use version 0.34 or later ====
 
  +
Run the NPL-update script to populate the database. This script is located in the <code>webwork2/bin</code> directory and may be invoked from anywhere.
  +
<pre>
  +
$ /opt/webwork/webwork2/bin/NPL-update
  +
Mysql database reinitialized.
  +
Reading in textbook data.
  +
Converting data from tagged pgfiles into mysql.
  +
Number of files processed:
  +
100 200 300 400 500 600 700 800 900 1000
  +
...
  +
Done.
  +
$
  +
</pre>
   
Versions of DateTime::TimeZone (a component of DateTime) below 0.34 suffer from a problem with displaying some time zones. Make sure you have version 0.34 or later.
 
  +
There is no need to add symlinks to course <code>templates</code> directory, as is necessary with file based Problem Libraries. It is done automatically.
   
==== Problems building Time::HiRes ====
 
  +
<dt>Browsing the NPL
  +
<dd>
  +
Log into a WeBWorK course and select <strong>Library Browser</strong> from the links menu. On the resulting screen, click the <strong>Problem Library</strong> button.
   
Some users have reported problems building Time::HiRes through CPAN. If this is your experience, try downloading the Time::HiRes tarball from http://search.cpan.org/~jhi/Time-HiRes/ and building it manually (<code>perl Makefile.PL && make && make test && make install</code>).
 
  +
<dt>Updating the NPL
  +
<dd>
  +
The cvs repository for the NPL is updated as problems are added, additional meta-data is added, or problem bugs are fixed. So, it is a good idea to update your copy of the NPL periodically, say once per semester.
   
==== Problems building Apache::Request or Apache2::Request ====
 
  +
To update, run the <code>cvs update</code> command to download the latest versions from our server. Then, re-run <code>loadDB2</code> (WeBWorK 2.3.x) or NPL-update (WeBWorK 2.4.x).
  +
<pre>
  +
$ cd /opt/webwork/libraries/database_problems
  +
$ cvs -q update -dPA
  +
$ ./loadDB2
  +
What is the root password for mysql? *****
  +
Mysql database reinitialized
  +
Converting data from tagged pgfiles into mysql.
  +
$
  +
</pre>
   
Apache::Request is one component of the libapreq library. If you run into problems building it through CPAN, try downloading the libapreq tarball from http://httpd.apache.org/apreq/.
 
  +
<dt>Contributing to the NPL
  +
<dd>
  +
If you have written new problems, you might like to contribute contribute them to the NPL so others can benefit from them as well.
  +
<ul>
  +
<li>[[Tagging Problems]]
  +
<li>[[How to Submit Problems to the NPL]]
  +
</ul>
   
Apache 2.0.x users should use libapreq2.
 
  +
</dl>
   
=== mod_perl ===
 
  +
=File Based Problem Libraries=
  +
These libraries consist of a directory tree organized roughly by the chapters of
  +
a canonical calculus book (or in some cases a canonical text for another subject).
  +
There is no database index of tagged meta-data.
   
WeBWorK uses mod_perl to interface with the Apache server. If compiling mod_perl from source, use the <code>EVERYTHING=1</code> flag to enable all mod_perl features. Most vendors compile their mod_perl packages with this setting enabled.
 
  +
It is envisioned that the material in these libraries will eventually be given meta-data,checked for errors and duplicates and folded into the NPL.
   
==== Apache 1.3 ====
 
  +
The CVS links allow you to inspect the question collections from the web.
   
* Source: http://perl.apache.org/download/
 
  +
See [[ CvsProblemLibraryInstructions]] for instructions on downloading the contents of these libraries via CVS.
* Debian/Ubuntu: <code>libapache-mod-perl</code>
 
  +
* Red Hat/Fedora: build from source; see below.
 
  +
<dl>
* Gentoo: <code>mod_perl </code>
 
  +
<dt>Arizona State University Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/asu_problib/?cvsroot=Arizona+State+University CVS ] )
  +
<dd>
   
==== Apache 2.0 ====
 
  +
This problem library is now empty. All of the problems have been moved into the National Problem Library.
   
* Source: http://perl.apache.org/download/
 
  +
<dt>The College of New Jersey Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/tcnj_problib/?cvsroot=The+College+of+New+Jersey CVS] )
* Debian/Ubuntu: <code>libapache2-mod-perl</code>
 
* Red Hat/Fedora: build from source
 
   
==== RHEL4/Fedora build notes ====
 
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/tcnj co tcnj_problib</code>
   
''I had to use the flags below to get the compile to work correctly:''
 
  +
The College of New Jersey (TCNJ) makes a large number of linear algebra
  +
problems available in this collection. Please send links of any problems that don't
  +
work to Tom Hagedorn (hagedorn@tcnj.edu.
   
perl Makefile.PL EVERYTHING=1 DO_HTTPD=1 USE_APACI=1 APACHE_PREFIX=/usr/local/apache
 
  +
<dt>Dartmouth College Library [http://cvs.webwork.rochester.edu/viewcvs.cgi/dartmouth_problib/?cvsroot=Dartmouth+College CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/dartmouth co dartmouth_problib</code>
   
-- Mark Hamrick
 
  +
This library has problems compatible with the Marsden and Tromba multi-dimensional
  +
calculus book. It also has problems compatible with the later chapters in Stewart's
  +
calculus book.http://cvs.webwork.rochester.edu/viewcvs.cgi/dartmouth_problib/?cvsroot=Dartmouth+College
   
=== MySQL ===
 
  +
<dt>Detroit County Day School Math Problem Library (High School) ([http://cvs.webwork.rochester.edu/viewcvs.cgi/dcds_problib/?cvsroot=Detroit+County+Day+School CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/dcds co dcds_problib</code>
   
MySQL 4.0.x or later is required. If you are going to be using the experimental Moodle Integration, MySQL 4.1.x or later is required.
 
  +
These high school and pre-calculus level problems were written by
  +
Mark Schmidt at Detroit Country Day School. Send corrections to
  +
gage at math.rochester.edu or to M. Schmitt at dcds.edu
   
* Source: http://dev.mysql.com/downloads/
 
  +
<dt> Freeman: Problems inspired by Raguski Calculus book (CVS )
* Debian/Ubuntu: 4.0.x: <code>mysql-server</code>; 4.1.x: <code>mysql-server-4.1</code>
 
  +
<dd>
* RHEL4/Fedora: <code>mysql-sever</code>, <code>mysql-client</code>
 
* Gentoo: <code>mysql </code>
 
   
=== LaTeX ===
 
  +
<dt>Indiana University Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/indiana_problib/?cvsroot=Indiana+University CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/indiana co indiana_problib</code>
   
WeBWorK requires LaTeX for generating hardcopy output and displaying mathematics graphically. Any standard LaTeX distribution that provides the commands <code>latex</code> and <code>pdflatex</code> should work. We use TeTeX.
 
  +
<dt>Northern Arizona University Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/nau_problib/?cvsroot=Northern+Arizona+University CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/nau co nau_problib</code>
   
* Source: http://tug.org/tetex/
 
  +
The Northern Arizona University Library has new problems for graph theory,
* Debian/Ubuntu: <code>tetex-bin</code>, <code>tetex-extra</code>
 
  +
for statistics and for pre-calculus. The setExamples cleans up some of the problems
* Red Hat/Fedora: <code>tetex</code>, <code>tetex-latex</code>
 
  +
in Rochester Library's setMAAtutorial and adds several more.
* Gentoo: <code>tetex</code>
 
  +
Send corrections to Nandor.Sieben@NAU.EDU.
   
=== Netpbm ===
 
  +
<dt>Union College Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/union_problib/?cvsroot=Union+College CVS] )
   
WeBWorK requires Netpbm to convert images among the GIF, PNG, and EPS formats.
 
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/union co union_problib</code>
   
* Source: http://netpbm.sf.net/
 
  +
The Union College Math Problem Library should now be fully funcitonal.
* Debian/Ubuntu: <code>netpbm</code>
 
  +
A few of the problems may not work as advertised, since they may
* Red Hat/Fedora: build from source
 
  +
have trouble finding the links to auxiliary materials, such as external graphs.
* Gentoo: <code>netpbm </code>
 
   
=== dvipng ===
 
  +
Davide Cervones and Kathryn Leash are principally responsible for designing these problems.
  +
The level set and 3d problems are particularly nice!!
   
WeBWorK uses dvipng to display mathematics graphically. It is only required if you wish to use the <code>images</code> display mode. dvipng requires the <code>preview.sty</code> file from the [http://preview-latex.sf.net/ preview-latex] package.
 
  +
Please send links of any problems that don't work to gage at math.rochester.edu or dpvc at union.edu or even better
  +
enter them into bugzilla via the "report problem bugs" on the PG editor page.
   
* Source: http://dvipng.sf.net/
 
  +
<dt> UC Santa Barbara and Brooks/Cole: Problems inspired by Stewart's Calculus book ([http://cvs.webwork.rochester.edu/viewcvs.cgi/ucsb_problib/?cvsroot=UC+Santa+Barbara CVS] )
* Debian: <code>dvipng</code>, <code>preview-latex-style</code>
 
  +
<dd><i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/ucsb co ucsb_problib</code>
* Red Hat/Fedora: <code>preview-latex-common-0.9.1-1.fedora.noarch.rpm</code>
 
* Gentoo: <code>dvipng</code>
 
   
WeBWorK is initially configured to work with dvipng 1.0 or greater, but can be reconfigured to work with dvipng 0.8 or 0.9. See <code>webwork2/lib/WeBWorK/Constants.pm</code> for details.
 
  +
<dt>University of Georgia Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/uga_problib/?cvsroot=University+of+Georgia CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/uga co uga_problib</code>
   
=== TtH ===
 
  +
<dt>University of Michigan Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/umich_problib/?cvsroot=University+of+Michigan CVS])
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/umich co umich_problib</code>
   
WeBWorK uses TtH to display mathematics as formatted HTML. It is only required if you wish to use the <code>formatted-text</code> display mode.
 
  +
This library contains problems related to the Hughes-Hallet et.al. Harvard Calculus text.
  +
Send corrections to Gavin Larose (glarose at umich.edu) or even better enter
  +
them into bugzilla via the "report problem bugs" on the PG editor page.
  +
WeBWorK mathematics homework problems created at the University of
  +
Georgia. Send corrections to Ted Ashton (ashted at math.uga.edu) or even better
  +
enter them into bugzilla via the "report problem bugs" on the PG editor page.
   
* Source: http://hutchinson.belmont.ma.us/tth/
 
  +
<dt>University of Rochester Math Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/rochester_problib/?cvsroot=UR+Problem+Library CVS] )
* Debian:*|| <code>tth</code>
 
  +
<dd>
* Red Hat/Fedora: build from source
 
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_problib</code>
* Gentoo: <code>tth</code>
 
   
== Installing the WeBWorK files ==
 
  +
The Rochester Math Problem Library should now be fully funcitonal.
  +
A few of the problems may not work as advertised, since they may
  +
have trouble finding the links to auxiliary materials, such as external graphs.
  +
Please send links of any problems that don't work to gage at math.rochester.edu
  +
or even better enter them into bugzilla via the "report problem bugs" on the PG editor page.
   
WeBWorK is typically installed using CVS. We provide version tags that correspond to each released version of WeBWorK. This ensures that you can maintain a stable system, and experimental upgrades will not be applied to your installation.
 
  +
The Rochester library includes many problems prepared by Zbigniew Fiedorowicz at Ohio State University as well as a large number of problems prepared by Jun Wang at Alabama State University
   
We also provide tarballs for each release. They contain the necessary CVS data to update from CVS at a later date. Choose a tarball if for some reason you do not want to use CVS. Keep in mind that because of the layout of files within the <code>webwork2</code> directory tree, upgrading an existing installation is harder using a tarball than using CVS.
 
  +
<dt>University of Rochester Physics Problem Library ([http://cvs.webwork.rochester.edu/viewcvs.cgi/rochester_physics_problib/?cvsroot=UR+Problem+Library CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_physics_problib</code>
   
=== Creating the base directory directory ===
 
  +
These physics problems were originally written in CAPA and mechanically
  +
translated into the PG language. Thanks to help from Frank Wolfs the
  +
.eps file pictures now display properly.
   
Before you begin installing files, create a base directory to hold them. We prefer <code>/opt/webwork</code>:
 
  +
<dt>University of Rochester Grade 8 Math Problems ([http://cvs.webwork.rochester.edu/viewcvs.cgi/rochester_grade8problems/?cvsroot=UR+Problem+Library CVS] )
  +
<dd>
  +
<i>Command line command for cvs checkout: </i><code>cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_grade8problems</code>
   
# mkdir -p /opt/webwork
 
  +
These problems, written largly by Tori Sweetser, contain material at the level of
  +
the New York State 8th grade exams.
   
To make things easier during the installation, you can give yourself write permission to this directory. That way, you won't have to become root to install the WeBWorK files:
 
  +
Many of these problems are written using the multiple choice and
  +
matching tools. Send corrections to gage@math.rochester.edu
   
# chown yourNameHere /opt/webwork
 
  +
</dl>
  +
------
   
=== Installing from CVS ===
 
  +
You can find tarballs of these library problems at http://webhost.math.rochester.edu/webworkdocs/librarytarballsLibrary
   
Installing from CVS allows you more flexibility in selecting versions of the WeBWorK code between or ahead of releases. You have several options, depending on which release tag you select when accessing the CVS repository.
 
  +
=Additonal Problem Library Information =
 
==== CVS tags ====
 
 
'''''Released version:''''' By specifying the '''rel-2-4-1''' tag, you get the same version of the code that you would by downloading the WeBWorK 2.4.1 tarball. This is the most conservative option. Updating will have no effect -- this code will never change.
 
 
'''''Released version with patches:''''' By specifying the '''rel-2-4-dev''' tag, you can stay up to date with the latest bug fixes against the released version of WeBWorK 2.4. Few, if any, new features are introduced on a patch branch. We recommend that you choose this option.
 
 
'''''Latest code:''''' If you do not specify a release tag, you will get the latest code. Since this code is a work in progress, it is sometimes unstable or broken. If you require features that are not in a stable release, and are willing to devote more time to keeping your installation running smoothly, this may be the option for you.
 
 
No matter what tag you chose, you can change later by specifying a new tag when running <code>cvs upgrade</code>.
 
 
==== New installation from CVS ====
 
 
If you do not have an existing WeBWorK installation, use the following commands to check out copies of the <code>webwork2</code> and <code>pg</code> modules. If you are prompted for a password, press enter.
 
 
'''''Released version:'''''
 
 
<code>$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/system checkout -r rel-2-4-1 webwork2</code><br/>
 
<code>$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/system checkout -r rel-2-4-0 pg</code>
 
 
'''''Released version with patches:'''''
 
 
<code>$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/system checkout -r rel-2-4-dev webwork2 pg</code>
 
 
'''''Latest development code:'''''
 
 
<code>$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/system checkout webwork2 pg</code>
 
 
The message <code>warning: cannot open /webwork/cvs/system/CVSROOT/val-tags read/write: Permission denied</code> is harmless and should be ignored.
 
 
After checkout finishes, become root and move the directories to the your installation directory. I prefer <code>/opt/webwork</code>:
 
 
# cp -r webwork2 /opt/webwork/webwork2
 
# cp -r pg /opt/webwork/pg
 
 
==== Upgrading using CVS ====
 
 
If you already have an existing WeBWorK installation, use the following commands to update your exsting files to version 2.4. You may need to become root to run these commands (depending on your permissions situation).
 
 
Take note of the messages that CVS gives during the update. If you have modified files, you may see the message <code>Merging differences between ''version1'' and ''version2'' into _filename_</code>. This indicates that the file in question is updated in WeBWorK 2.4, and since you also made local modifications to it, CVS is attempting to merge the two changed versions.
 
 
If this process fails, because the same parts of the file were modified in both versions, you will see the message <code>rcsmerge: warning: conflicts during merge</code>. If you end up in this situation, you will need to resolve the conflict by editing the file in question. Consult this [http://ximbiot.com/cvs/manual/cvs-1.11.22/cvs_10.html#SEC85 conflicts example] from the CVS manual.
 
 
The message <code>warning: cannot open /webwork/cvs/system/CVSROOT/val-tags read/write: Permission denied</code> is harmless and should be ignored.
 
 
'''''Released version:'''''
 
 
cd /opt/webwork/webwork2
 
cvs -q update -dP -r rel-2-4-1
 
cd /opt/webwork/pg
 
cvs -q update -dP -r rel-2-4-0
 
 
'''''Released version with patches:'''''
 
 
cd /opt/webwork/webwork2
 
cvs -q update -dP -r rel-2-4-dev
 
cd /opt/webwork/pg
 
cvs -q update -dP -r rel-2-4-dev
 
 
'''''Latest development code:'''''
 
 
cd /opt/webwork/webwork2
 
cvs -q update -dPA
 
cd /opt/webwork/pg
 
cvs -q update -dPA
 
 
=== Installing from a tarball ===
 
 
Tarballs of WeBWorK releases are available from our [http://sf.net/project/showfiles.php?group_id=93112 SourceForge file release] page. You will need to download both a <code>webwork</code> tarball and a <code>pg</code> tarball. Make sure that the versions of the tarballs match. You can choose either a GZip or BZip2 archive.
 
 
After downloading the tarballs, untar them somewhere (like your home directory):
 
 
$ tar -xjf webwork-2.4.1.tar.bz2
 
$ tar -xjf pg-2.4.0.tar.bz2
 
 
If you have an existing WeBWorK installation, move your existing <code>webwork2</code> and <code>pg</code> directories to <code>webwork2.OLD</code> and <code>pg.OLD</code>, respectively. (You will move your existing courses and configuration over to the new directories later.)
 
 
Then, become root and move the directories to the your installation directory. The installation directory should '''not''' be web-accessible. I prefer <code>/opt/webwork</code>:
 
 
# cp -r webwork-2.4.1 /opt/webwork/webwork2
 
# cp -r pg-2.4.0 /opt/webwork/pg
 
 
From now on, we will assume that WeBWorK 2 is installed in <code>/opt/webwork/webwork2</code> and PG is installed in <code>/opt/webwork/pg</code>.
 
 
=== Installing fonts for jsMath ===
 
 
jsMath is a display mode that renders math expressions using a JavaScript implementation of the TeX math layout engine. For more information about jsMath, see http://www.math.union.edu/~dpvc/jsmath/.
 
 
Version 2.0 of jsMath introduced a new fallback method for when the TeX fonts are not available on the student's computer. This uses images of the individual TeX characters in place of the TeX fonts, but this requires a large number of individual character images in a wide range of sizes. These are distributed in <code>webwork2/htdocs/jsMath/jsMath-fonts.tar.gz</code>, and you need to unpack this tarball before jsMath will work properly. Use the command
 
 
$ cd /opt/webwork/webwork2/htdocs/jsMath
 
$ tar -xzvf jsMath-fonts.tar.gz
 
 
This will unpack the archive. Since there are 20,000 tiny files, it can take a long time, so the =v= option is used to show you the names as they are unpacked so that you know the command is actually doing something. Once the images are unpacked, jsMath's image mode fallback (the default fallback method) will work properly, and most students will have results as good as they would with the TeX fonts installed.
 
 
If you do not wish to install the jsMath image fonts (to save space, for example), you should change the value of <code>noImageFonts</code> in the <code>$pg{displayModeOptions}{jsMath}</code> hash in <code>global.conf</code> to 1. This will prevent jsMath from using the image fallback methods.
 
 
See also: [[#jsMath_settings|jsMath settings]]
 
 
=== Creating the courses directory ===
 
 
The courses directory should be located at <code>/opt/webwork/courses</code>. Placing the courses directory outside the <code>webwork2</code> directory makes updates easier.
 
 
You can create your courses directory from the <code>courses.dist</code> directory distributed with WeBWorK. This directory contains the skeleton of a course called <code>modelCourse</code>, which contains the template files for three demo sets. You can opt to copy templates from this set when creating new courses.
 
 
$ cd /opt/webwork/webwork2
 
$ cp -RPp courses.dist ../courses
 
 
If you prefer not to use <code>modelCourse</code>, you can create an empty courses directory instead:
 
 
$ cd /opt/webwork
 
$ mkdir courses
 
 
If you are upgrading from WeBWorK 2.2.x, move your existing courses into the new <code>/opt/webwork/courses</code> directory.
 
 
=== Making copies of distribution configuration files ===
 
 
Some files are distributed with the <code>.dist</code> suffix. You must make copies lacking the <code>.dist</code> suffix for WeBWorK to be able to find them. This is done to ease updating with CVS. The <code>.dist</code> files may be updated during a CVS update, but your local versions will be left untouched.
 
 
Before configuring the system, you must make local copies of the <code>global.conf</code> and <code>database.conf</code> configuration files, located in <code>/opt/webwork/webwork2/conf/</code>:
 
 
$ cd /opt/webwork/webwork2/conf
 
$ cp global.conf.dist global.conf
 
$ cp database.conf.dist database.conf
 
 
=== Setting permissions ===
 
 
The PG installation directory and files should be owned by root and not writable by other users:
 
 
# cd /opt/webwork/pg
 
# chown -R root:root .
 
# chmod -R u+rwX,go+rX .
 
 
Most WeBWorK directories and files should also be owned by root and not writable by other users:
 
 
# cd /opt/webwork/webwork2
 
# chown -R root:root .
 
# chmod -R u+rwX,go+rX .
 
 
Certain data directories need to be writable by the web server. These are <code>DATA</code>, <code>courses</code>, <code>htdocs/tmp</code>, <code>logs</code>, and <code>tmp</code>. It is convenient to give WeBWorK administrators access to these directories as well, so they can perform administrative tasks such as removing temporary files, creating and editing courses from the command line, managing logs, and so on.
 
 
The simplest way to set this up assumes that all WeBWorK administrators have root access. In this case, directories that must be writable by the web server should be given the ''group'' of the web server. In the following examples, it is assumed that the web server's group is <code>www-data</code>.
 
 
If you wish to perform administrative tasks without becoming root, you can either add the WeBWorK administrators to the web server's group, or create a new group called <code>wwdata</code>, containing both the WeBWorK administrators and the web server.
 
 
If you chose not to create the <code>wwdata</code> group, the WeBWorK data directories should have the group of the web server:
 
 
# cd /opt/webwork/webwork2
 
# chgrp -R www-data DATA ../courses htdocs/tmp logs tmp
 
# chmod -R g+w DATA ../courses htdocs/tmp logs tmp
 
# find DATA/ ../courses/ htdocs/tmp/ logs/ tmp/ -type d -a ! -name CVS -exec chmod g+s {} \;
 
 
If you chose to create the <code>wwdata</code> group, the WeBWorK directories that must be writable by the web server should have that group:
 
 
# cd /opt/webwork/webwork2
 
# chgrp -R wwdata DATA ../courses htdocs/tmp logs tmp
 
# chmod -R g+w DATA ../courses htdocs/tmp logs tmp
 
# find DATA/ ../courses/ htdocs/tmp/ logs/ tmp/ -type d -a ! -name CVS -exec chmod g+s {} \;
 
 
==== CVS updates and permissions ====
 
 
In the instructions above, you set most WeBWorK and PG files to be owned and only writable by root. If you are planning to do in-place updates of the system with CVS, you may want to set those files to be owned by a regular user instead. That will let you avoid running CVS as root, which could be a security risk. One option is to create a user account that cannot be logged into directly and use it only for WeBWorK files.
 
 
== Configuring your shell ==
 
 
To make working with WeBWorK easier, there are a couple of changes you can make to your shell environment.
 
 
Add the WeBWorK <code>bin</code> directory to your path. This will allow you to run WeBWorK command-line utilities without typing the full path to the utility. If you installed WeBWorK in the default location of <code>/opt/webwork/webwork2</code>, add the directory <code>/opt/webwork/webwork2/bin</code> to your path.
 
 
{| border="1"
 
|-
 
| '''if your shell is''' || '''put this line''' || '''in this file'''
 
|-
 
| <code>bash</code> || <tt>export PATH=$PATH:/opt/webwork/webwork2/bin</tt> || <code>~/.bashrc</code>
 
|-
 
| <code>tcsh</code> || <tt>setenv PATH $PATH:/opt/webwork/webwork2/bin</tt> || <code>~/.cshrc</code>
 
 
|}
 
 
Set the <code>WEBWORK_ROOT</code> environment variable. Some command-line scripts rely on this variable to find other WeBWorK files.
 
 
{| border="1"
 
|-
 
| '''if your shell is''' || '''put this line''' || '''in this file'''
 
|-
 
| <code>bash</code> || <tt>export WEBWORK_ROOT=/opt/webwork/webwork2</tt> || <code>~/.bashrc</code>
 
|-
 
| <code>tcsh</code> || <tt>setenv WEBWORK_ROOT /opt/webwork/webwork2</tt> || <code>~/.cshrc</code>
 
 
|}
 
 
== Configuring WeBWorK ==
 
 
Most WW configuration is done in the file <code>/opt/webwork/webwork2/conf/global.conf</code>. This file provides system-wide configuration settings, and defaults for course settings. Any setting in this file can be overridden in the <code>course.conf</code> file for a particular course.
 
 
There are several options that must be set for WW to work with your system. The rest of the file consists of customization options.
 
 
=== Seed variables ===
 
 
These are the main configuration variables of WeBWorK. The are used by the Apache configuration and by the system itself. Many other settings rely on these variables:
 
 
{| border="1"
 
|-
 
| '''variable''' || '''description'''
 
|-
 
| <code>$webwork_url</code> || The URL associated with the WeBWorK handler. Usually <code>/webwork2</code>.
 
|-
 
| <code>$pg_root</code> || The path to the PG directory. Usually <code>/opt/webwork/pg</code>.
 
|-
 
| <code>$webwork_htdocs_url</code> || The URL of static WeBWorK hypertext files. Usually <code>/webwork2_files</code>.
 
|-
 
| <code>$webwork_htdocs_dir</code> || The path to the static WeBWorK hypertext files. Usually <code>$webwork_dir/htdocs</code>.
 
|-
 
| <code>$webwork_courses_url</code> || The URL of the courses directory. Usually <code>/webwork2_course_files</code>.
 
|-
 
| <code>$webwork_courses_dir</code> || The path to the courses directory. Usually <code>$webwork_dir/courses</code>.
 
 
|}
 
 
=== Paths to external programs ===
 
 
To avoid executing malicious code, WW calls external programs using full path names.
 
 
{| border="1"
 
|-
 
| '''variable''' || '''description'''
 
|-
 
| <code>$externalPrograms{mkdir}</code> || Path to <code>mkdir</code> binary. Usually <code>/bin/mkdir</code>.
 
|-
 
| <code>$externalPrograms{mysql}</code> || Path to <code>mysql</code> binary. Usually <code>/usr/bin/mysql</code> or <code>/usr/local/bin/mysql</code>.
 
|-
 
| <code>$externalPrograms{tar}</code> || Path to <code>tar</code> binary. Usually <code>/usr/bin/tar</code>.
 
|-
 
| <code>$externalPrograms{latex}</code> || Path to <code>latex</code> binary. Usually <code>/usr/bin/latex</code> or <code>/usr/local/bin/latex</code>.
 
|-
 
| <code>$externalPrograms{pdflatex}</code> || Path to <code>pdflatex</code> binary. Usually <code>/usr/bin/pdflatex</code> or <code>/usr/local/bin/pdflatex</code>.
 
|-
 
| <code>$externalPrograms{dvipng}</code> || Path to <code>dvipng</code> binary. Usually <code>/usr/bin/dvipng</code> or <code>/usr/local/bin/dvipng</code>.
 
|-
 
| <code>$externalPrograms{tth}</code> || Path to <code>tth</code> binary. Usually <code>/usr/bin/tth</code> or <code>/usr/local/bin/tth</code>.
 
|-
 
| <code>$externalPrograms{giftopnm}</code> || Path to <code>giftopnm</code> binary. Usually <code>/usr/bin/giftopnm</code> or <code>/usr/local/bin/giftopnm</code>.
 
|-
 
| <code>$externalPrograms{ppmtopgm}</code> || Path to <code>ppmtopgm</code> binary. Usually <code>/usr/bin/ppmtopgm</code> or <code>/usr/local/bin/ppmtopgm</code>.
 
|-
 
| <code>$externalPrograms{pnmtops}</code> || Path to <code>pnmtops</code> binary. Usually <code>/usr/bin/pnmtops</code> or <code>/usr/local/bin/pnmtops</code>.
 
|-
 
| <code>$externalPrograms{pnmtopng}</code> || Path to <code>pnmtopng</code> binary. Usually <code>/usr/bin/pnmtopng</code> or <code>/usr/local/bin/pnmtopng</code>.
 
|-
 
| <code>$externalPrograms{pngtopnm}</code> || Path to <code>pngtopnm</code> binary. Usually <code>/usr/bin/pngtopnm</code> or <code>/usr/local/bin/pngtopnm</code>.
 
 
|}
 
 
=== Mail settings ===
 
 
WW sends mail in three instances. The PG system sends mail to report answers to questionnaires and free-response problems. The mail merge module is used to send mail to course participants, i.e. to report scores. The feedback module allows participants to send mail to course instructors.
 
 
To send mail, WW needs the address of an SMTP server. When connecting to the SMTP server, it must also send an email address representing the sender of the email.
 
 
{| border="1"
 
|-
 
| '''variable''' || '''description'''
 
|-
 
| <code>$mail{smtpServer}</code> || The address of an SMTP server. If the local machine is running an SMTP server (as is likely), use <code>localhost</code>.
 
|-
 
| <code>$mail{smtpSender}</code> || The address to send when connecting to the SMTP server. This has nothing to do with the <code>From</code> address on the mail message.
 
 
|}
 
 
=== Database settings ===
 
 
The following settings are used in connecting to the MySQL database.
 
 
{| border="1"
 
|-
 
| '''variable''' || '''description'''
 
|-
 
| <code>$database_dsn</code> || The location of the WeBWorK database. Usually <code>dbi.mysql.webwork</code>. See the Perl DBI documentation for more information about DSNs.
 
|-
 
| <code>$database_username</code> || The username to use when connecting to the database. Usually <code>webworkWrite</code>.
 
|-
 
| <code>$database_password</code> || The password to use when connecting to the database. Use a secure, random password of sufficient length.
 
 
|}
 
 
The <code>$dbLayoutName</code> variable controls the default database layout that will be used for new courses. If you plan to use moodle on all new courses, set this to "sql_moodle". Otherwise, leave it set to the default, "sql_single".
 
 
You can override the default when creating a new course.
 
 
=== Timezone setting ===
 
 
You can set the local timezone to use when displaying times using the <code>$siteDefaults{timezone}</code> setting. To get a list of timezone names, run:
 
 
$ perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::all_names'
 
 
To get a list of valid timezone "links" (deprecated names), run:
 
 
$ perl -MDateTime::TimeZone -e 'print join "\n", DateTime::TimeZone::links'
 
 
Links can be shorter and more familiar, but they may be ambiguous.
 
 
=== Display modes ===
 
 
WeBWorK has several techniques for displaying homework problems. Which of these modes is available is controlled by the <code>$pg{displayModes}</code> list. To disable a display mode, comment out its line from the list by inserting a =#= character at the beginning of the line.
 
 
The supported display modes are as follows:
 
 
{| border="1"
 
|-
 
| '''display mode''' || '''status''' || '''description'''
 
|-
 
| <code>plainText</code> || STABLE || This mode shows the raw TeX source of mathematics. It is useful for debugging.
 
|-
 
| <code>formattedText</code> || DEPRECATED || This mode uses the <code>tth</code> program to represent mathematics as HTML table structures. Output quality depends on the browser. There are typically font problems on the Mac platform.
 
|-
 
| <code>images</code> || STABLE || This mode uses the <code>dvipng</code> program to represent mathematics as PNG images. This gives excellent output on all browsers, but uses more bandwidth, as the images must be sent to the client.
 
|-
 
| <code>jsMath</code> || STABLE || This mode uses jsMath to display mathematics. The raw TeX is sent to the client, where a JavaScript program displays it. This requires the client to have a decent JavaScript implementation, and can be slow on older machines.
 
|-
 
| <code>asciimath</code> || DEPRECATED || This mode converts mathematics to ASCIIMath on the server and uses a <nobpo>JavaScript to convert them to MathML on the client. Requires a Mozilla-based browser or MSIE with the MathPlayer plugin.
 
|-
 
| <code>LaTeXMathML</code> || EXPERIMENTAL || This mode is a modification of the <code>asciimath</code> mode that skips the intermediate ASCIIMath form. Requires a Mozilla-based browser or MSIE with the MathPlayer plugin.
 
 
|}
 
 
=== jsMath settings ===
 
 
When a student doesn't have the TeX fonts installed, jsMath can display a warning message pointing to the jsMath font download site. Since the image-mode fallback method is of high enough quality, most students will not feel the need to download and install the fonts, so this warning message is disabled by default. (It tended to worry the students, and there is a link to the download page on the control panel that is new in version 2.0 of jsMath).
 
 
jsMath settings are stored in the <code>$pg{displayModeOptions}{jsMath}</code> hash:
 
 
{| border="1"
 
|-
 
| '''variable''' || '''description'''
 
|-
 
| <code>reportMissingFonts</code> || Set to 1 if you want to have a message displayed for students who don't have the TeX fonts installed. The warning will only be shown on the first page they view that used jsMath (and there is a "hide" button that they can use to hide it even on that page). They can use the control panel to disable the warning messages permanently for their computer, if they want, so even if you turn on the warning message, it is not too intrusive.
 
|-
 
| <code>missingFontMessage</code> || An HTML string that will be used for the missing font message (when <code>reportMissingFonts</code> is non-zero). This string will replace the default warning message, and can be used to point to your own page of instructions for getting the fonts, for example, or for using the control panel to disable the warning.
 
|-
 
| <code>noImageFonts</code> || Set to 1 to prevent jsMath from using the image fallback method. This can be useful if you elected not to unpack the <code>jsMath-fonts.tar.gz</code> archive.
 
|-
 
| <code>processDoubleClicks</code> || By default, double-clicking on the math expression will display the TeX source that generated it. If you wish to disable this behavior, set this to 0. (Note that the raw TeX is still available in the page's HTML source.)
 
 
|}
 
 
== Configuring the database ==
 
 
WeBWorK uses a single MySQL database to store course data. By default, this database is named <code>webwork</code> and is accessed by a MySQL user named <code>webworkWrite</code>.
 
 
=== Creating a new database ===
 
 
If this is a new installation, you must create the <code>webwork</code> database:
 
 
$ mysql -u root -p mysql
 
Password: '''***'''
 
> CREATE DATABASE webwork;
 
> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, LOCK TABLES
 
ON webwork.* TO webworkWrite@localhost IDENTIFIED BY 'password';
 
> exit
 
Bye
 
$
 
 
(Replace <code>password</code> with the password you set for <code>$database_password</code> in <code>global.conf</code>.)
 
 
=== Using an existing database ===
 
 
If you already have a <code>webwork</code> database from WeBWorK 2.1.x or 2.2.x, you must run the utility <code>wwdb_check</code> to make sure that it is up-to-date for use with 2.4.x. You should '''not''' use this utility if you are upgrading from 2.3.x or an earlier version of 2.4.x. (For example, from 2.4.1 to 2.4.2.)
 
 
To run the utility:
 
 
$ /opt/webwork/webwork2/bin/wwdb_check
 
 
The script will look at the structure of your <code>webwork</code> database, and alert you to missing tables, missing fields, and incorrect field types. You will have the option to fix these problems.
 
 
WeBWorK 2.4 requires permision to <code>LOCK TABLES</code> in the <code>webwork</code> database. Use the <code>mysql</code> console to add it:
 
 
$ mysql -u root mysql
 
Password: '''***'''
 
> GRANT LOCK TABLES ON webwork.* TO webworkWrite@localhost;
 
> exit;
 
$
 
 
=== Automated database initialization and upgrade ===
 
 
WeBWorK 2.3.0 introduces an automatic database upgrade system. Rather than manually issuing SQL commands to make changes to the database, or using ad-hoc scripts like <code>wwdb_addgw</code>, there is a single script called <code>wwdb_upgrade</code> that applies any necessary updates. It should be run when creating a new database, and any time you upgrade WeBWorK.
 
 
$ /opt/webwork/webwork2/bin/wwdb_upgrade
 
 
Add the <code>-v</code> switch to get more information about what the script is doing.
 
 
=== Image depths database ===
 
 
The "images" display mode has the capability to store depth information in a <code>depths</code> table when equation images are generated. The information allows better alignment of images with surrounding text. In previous versions of WeBWorK, the <code>depths</code> table was stored in a separate database, named <code>DvipngDepths</code>. Starting with WeBWorK 2.3.0, it is stored in the <code>webwork</code> database itself.
 
 
If you are upgrading an existing installation, and you had set <code>$pg{displayModeOptions}{images}{dvipng_align}</code> to <code>mysql</code> in the old version, you have depths information stranded in your old <code>DvipngDepths</code> database, and existing images will lose access to this information.
 
 
The easiest way to solve this is to delete the existing images. This is probably a good idea anyway when upgrading since existing images won't take advantage of rendering improvements, dvipng improvements, etc. To delete the images:
 
 
$ /opt/webwork/webwork2/bin/remove_stale_images --days=0 --delete
 
 
== Configuring Apache ==
 
 
=== Testing mod_perl ===
 
 
To verify that mod_perl is installed, you can use mod_info to list the installed modules. If mod_info itself is disabled or not installed, you can either install/enable it, or skip this test and check using Apache::Status instead. The process for installing and enabling modules varies by distribution. To configure mod_perl, uncomment the location block <code>&lt;Location /server-info&gt;</code> in your Apache config file (usually <code>httpd.conf</code> or <code>apache.conf</code>). It should look something like this:
 
 
<Location /server-info>
 
SetHandler server-info
 
Order deny,allow
 
Deny from all
 
Allow from localhost
 
Allow from .yourschool.edu
 
</Location>
 
 
You may have to add the <code>Order</code>, <code>Deny</code>, and <code>Allow</code> lines yourself, or there may already be lines there you can customize. Restart Apache (<code>apachectl graceful</code>) and visit <code>http://yourserver.yourschool.edu/server-info</code>. You should see an entry in the list of active modules for mod_perl.
 
 
To further test mod_perl, you can install the Perl module Apache::Status. After installing, add the following section to your Apache config file:
 
 
<Location /perl-status>
 
SetHandler perl-script
 
PerlHandler Apache::Status
 
Order deny,allow
 
Deny from all
 
Allow from localhost
 
Allow from .yourschool.edu
 
</Location>
 
 
Restart Apache (<code>apachectl graceful</code>) and visit <code>http://yourserver.yourschool.edu/perl-status</code>. You should see a page listing various information about mod_perl.
 
 
=== Enabling WeBWorK ===
 
 
Once mod_perl is working, Apache must be configured to handle requests for WeBWorK. Apache provides access to WeBWorK through three URL locations:
 
 
* The location that is handled by the <code>Apache::WeBWorK</code> module, usually <code>/webwork2</code>.
 
* The location of system-wide resources, usually <code>/webwork2_files</code>.
 
* The location of course-specific resources, usually <code>/webwork2_course_files</code>.
 
 
WeBWorK ships with an Apache config file that you can include in your main Apache config file. The file is named <code>webwork.apache-config.dist</code> and located in the <code>conf</code> directory. First, copy the file to <code>webwork.apache-config</code>:
 
 
$ cd /opt/webwork/webwork2/conf
 
$ cp webwork.apache-config.dist webwork.apache-config
 
 
Then, edit the copy to set the <code>$webwork_dir</code> variable to the path of the directory containing the WeBWorK installation. This is usually <code>/opt/webwork/webwork2</code>. This value is used to read the WeBWorK configuration file and get the rest of the configuration data.
 
 
Further down in the file, you may want to customize the directives used to define the association between Apache and WeBWorK. Specifically, you may need to add the following to the <code>&lt;ocation&gt;</code> and <code>&lt;Directory&gt;</code> stanzas, to permit access:
 
 
Order allow,deny
 
Allow from all
 
 
After editing <code>webwork.apache-config</code>, append the following line to your Apache configuration file:
 
 
Include /opt/webwork/webwork2/conf/webwork.apache-config
 
 
If you are upgrading from a previous version of WeBWorK which did not use the <code>webwork.apache-config</code> file, you will need to remove the WeBWorK-related directives from your Apache configuration.
 
 
Then restart Apache and test your configuration:
 
 
* Test the <code>/webwork2</code> location by visiting <code>http://yourserver.yourschool.edu/webwork2</code>. You should see the WeBWorK home page, with no courses listed.
 
* Test the <code>/webwork2_files</code> location by visiting <code>http://yourserver.yourschool.edu/webwork2_files</code>. You should see the "WeBWorK Placeholder Page".
 
* You cannot test the <code>/webwork2_course_files</code> location until you have created a course.
 
 
=== Experimental support for Apache 2.0.x ===
 
 
If you are using Apache 2.0.x, follow hte directions above, with these changes:
 
 
Enable the libapreq module by adding the following line to your Apache2 configuration file. Place this line with the other <code>LoadModule</code> lines.
 
 
LoadModule apreq_module modules/mod_apreq.so
 
 
Use the module Apache2::Status in place of Apache::Status.
 
 
Use the file <code>webwork.apache2-config</code> in place of <code>webwork.apache-config</code>.
 
 
== Creating the admin course ==
 
 
WeBWorK includes web-based course management tools. Access to these tools is controlled by a special course named <code>admin</code>. The instructors in this course are permittied to perform administrative functions. If the admin course exists, a '''Course Administration''' link will appear on the WeBWorK home page.
 
 
If you created a <code>wwadmin</code> group, create the admin course as follows:
 
 
$ cd /opt/webwork/courses
 
$ newgrp wwadmin
 
$ umask 2
 
$ addcourse
 
$ addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin
 
$ exit
 
 
If you did not create a <code>wwadmin</code> group, create the admin course as follows:
 
 
$ sudo -u www-data addcourse admin --db-layout=sql_single --users=adminClasslist.lst --professors=admin
 
 
Replace <code>www-data</code> with the user your webserver runs as.
 
 
See [[Administrator's_Guide/Course_Administration#Permissions_issues|permissions issues]] for more about getting the permission right when using the command-line tools.
 
 
After you create the course, visit the WeBWorK home page on your server, usually located at <code>http://yourserver.yourschool.edu/webwork2</code>. Click on the '''Course Administration''' link. You can also access the admin course directly, at <code>http://yourserver.yourschool.edu/webwork2/admin</code>.
 
 
To log in, enter <code>admin</code> for your username and <code>admin</code> for your password. Once logged into the admin course, the first thing you should do is change the password for the admin account. You can do this by clicking the '''Password/Email''' link on the links menu. After you do this, you may add accounts for any additional people who should have administrative access using the '''Class List Editor''' link.
 
 
== Where to go from here ==
 
 
 
 
Read the [[Administrator's Guide/Course Administration|Course Administration]] for more information about managing courses.
 
 
Read [[Problem Libraries]] for information on installing libraries of pre-written WeBWorK problems.
 
 
Read MoodleIntegration for information on including WeBWorK problem sets in Moodle courses. (Experimental)
 
 
Read LdapAuthentication for information about LDAP authentication. (Experimental)
 
 
Consult the WeBWorKDocs topic for other WeBWorK documentation.
 

Revision as of 18:43, 7 February 2008

National Problem Library (NPL)

The National Problem Library contains problems from several of the File Based Problem Libraries, including all of the problems from the Arizona State, Rochester, Cal State Long Beach, University of Virginia libraries. It also contains most, if not all, of the problems from Union College, College of New Jersey, Dartmouth, Ohio State, Northern Arizona University, and Indiana University.

In addition to merging these problem collections into a single collection, WeBWorK provides a different interface to these problems. Problems in the NPL are marked internally with meta-data, and instructors can search for problems on the basis of this data. This mechanism is built into WeBWorK's library browser. In particular, one can search hierarchically by course, chapter, section. To a limited extent, problems have been indexed against sections of textbooks in which case an instructor can also search for problems on that basis. WeBWorK stores this information in a database, so part of the installation involves loading meta-data into the database.

Obtaining the NPL
First, make sure you have an /opt/webwork/libraries directory:
$ mkdir -p /opt/webwork/libraries

The database problem library can be downloaded from the ASU CVS repository.

$ cd /opt/webwork/libraries
$ cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/asu co database_problems

If you are running WeBWorK 2.3.x, you must create a ProblemLibrary database on your MySQL server. (* represents the MySQL root password.)

$ mysql -u root
Password: *****
> CREATE DATABASE ProblemLibrary;
> GRANT SELECT on ProblemLibrary.* TO webworkWrite@localhost;
> quit
Bye.
$

If you are running WeBWorK 2.4.x, this is not necessary as the NPL indexes are stored within the main webwork database.

Configure WeBWorK to access the problem library. The settings are in global.conf:

For WeBWorK 2.3.x:

variable description
$problemLibrary{root} Path to database_problems directory. Should be /opt/webwork/libraries/database_problems.
$problemLibrary{version} Version of the problem library database. Should be 2.
$problemLibrary{sourceSQL} Name of the database. Should be ProblemLibrary.
$problemLibrary{userSQL} Username to use when connecting to the database. Can usually be left as $database_username.
$problemLibrary{passwordSQL} Password to use when connecting to the database. Can usually be left as $database_password.


For WeBWorK 2.4.x

variable description
$problemLibrary{root} Path to database_problems directory. Should be /opt/webwork/libraries/database_problems.
$problemLibrary{version} Version of the problem library database. Should be 2.
$problemLibrary_db{dbsource} Name of the database. Can usually be left as $database_dsn.
$problemLibrary_db{user} Username to use when connecting to the database. Can usually be left as $database_username.
$problemLibrary_db{passwd} Password to use when connecting to the database. Can usually be left as $database_password.

Finally, populate the database:

For WeBWorK 2.3.x:

Run the loadDB2 script to populate the database. This script must be run from the database_problems directory.

$ cd /opt/webwork/libraries/database_problems
$ ./loadDB2
What is the root password for mysql? *****
Mysql database reinitialized
Converting data from tagged pgfiles into mysql.
$ 


For WeBWorK 2.4.x:

Run the NPL-update script to populate the database. This script is located in the webwork2/bin directory and may be invoked from anywhere.

$ /opt/webwork/webwork2/bin/NPL-update
Mysql database reinitialized.
Reading in textbook data.
Converting data from tagged pgfiles into mysql.
Number of files processed:
   100   200   300   400   500   600   700   800   900  1000
...
Done.
$ 

There is no need to add symlinks to course templates directory, as is necessary with file based Problem Libraries. It is done automatically.

Browsing the NPL
Log into a WeBWorK course and select Library Browser from the links menu. On the resulting screen, click the Problem Library button.
Updating the NPL
The cvs repository for the NPL is updated as problems are added, additional meta-data is added, or problem bugs are fixed. So, it is a good idea to update your copy of the NPL periodically, say once per semester. To update, run the cvs update command to download the latest versions from our server. Then, re-run loadDB2 (WeBWorK 2.3.x) or NPL-update (WeBWorK 2.4.x).
$ cd /opt/webwork/libraries/database_problems
$ cvs -q update -dPA
$ ./loadDB2
What is the root password for mysql? *****
Mysql database reinitialized
Converting data from tagged pgfiles into mysql.
$ 
Contributing to the NPL
If you have written new problems, you might like to contribute contribute them to the NPL so others can benefit from them as well.

File Based Problem Libraries

These libraries consist of a directory tree organized roughly by the chapters of a canonical calculus book (or in some cases a canonical text for another subject). There is no database index of tagged meta-data.

It is envisioned that the material in these libraries will eventually be given meta-data,checked for errors and duplicates and folded into the NPL.

The CVS links allow you to inspect the question collections from the web.

See CvsProblemLibraryInstructions for instructions on downloading the contents of these libraries via CVS.

Arizona State University Math Problem Library (CVS )
This problem library is now empty. All of the problems have been moved into the National Problem Library.
The College of New Jersey Math Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/tcnj co tcnj_problib The College of New Jersey (TCNJ) makes a large number of linear algebra problems available in this collection. Please send links of any problems that don't work to Tom Hagedorn (hagedorn@tcnj.edu.
Dartmouth College Library CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/dartmouth co dartmouth_problib This library has problems compatible with the Marsden and Tromba multi-dimensional calculus book. It also has problems compatible with the later chapters in Stewart's calculus book.http://cvs.webwork.rochester.edu/viewcvs.cgi/dartmouth_problib/?cvsroot=Dartmouth+College
Detroit County Day School Math Problem Library (High School) (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/dcds co dcds_problib These high school and pre-calculus level problems were written by Mark Schmidt at Detroit Country Day School. Send corrections to gage at math.rochester.edu or to M. Schmitt at dcds.edu
Freeman: Problems inspired by Raguski Calculus book (CVS )
Indiana University Math Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/indiana co indiana_problib
Northern Arizona University Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/nau co nau_problib The Northern Arizona University Library has new problems for graph theory, for statistics and for pre-calculus. The setExamples cleans up some of the problems in Rochester Library's setMAAtutorial and adds several more. Send corrections to Nandor.Sieben@NAU.EDU.
Union College Math Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/union co union_problib The Union College Math Problem Library should now be fully funcitonal. A few of the problems may not work as advertised, since they may have trouble finding the links to auxiliary materials, such as external graphs. Davide Cervones and Kathryn Leash are principally responsible for designing these problems. The level set and 3d problems are particularly nice!! Please send links of any problems that don't work to gage at math.rochester.edu or dpvc at union.edu or even better enter them into bugzilla via the "report problem bugs" on the PG editor page.
UC Santa Barbara and Brooks/Cole: Problems inspired by Stewart's Calculus book (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/ucsb co ucsb_problib
University of Georgia Math Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/uga co uga_problib
University of Michigan Math Problem Library (CVS)
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/umich co umich_problib This library contains problems related to the Hughes-Hallet et.al. Harvard Calculus text. Send corrections to Gavin Larose (glarose at umich.edu) or even better enter them into bugzilla via the "report problem bugs" on the PG editor page. WeBWorK mathematics homework problems created at the University of Georgia. Send corrections to Ted Ashton (ashted at math.uga.edu) or even better enter them into bugzilla via the "report problem bugs" on the PG editor page.
University of Rochester Math Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_problib The Rochester Math Problem Library should now be fully funcitonal. A few of the problems may not work as advertised, since they may have trouble finding the links to auxiliary materials, such as external graphs. Please send links of any problems that don't work to gage at math.rochester.edu or even better enter them into bugzilla via the "report problem bugs" on the PG editor page. The Rochester library includes many problems prepared by Zbigniew Fiedorowicz at Ohio State University as well as a large number of problems prepared by Jun Wang at Alabama State University
University of Rochester Physics Problem Library (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_physics_problib These physics problems were originally written in CAPA and mechanically translated into the PG language. Thanks to help from Frank Wolfs the .eps file pictures now display properly.
University of Rochester Grade 8 Math Problems (CVS )
Command line command for cvs checkout: cvs -d :pserver:anoncvs@cvs.webwork.rochester.edu:/webwork/cvs/rochester co rochester_grade8problems These problems, written largly by Tori Sweetser, contain material at the level of the New York State 8th grade exams. Many of these problems are written using the multiple choice and matching tools. Send corrections to gage@math.rochester.edu

You can find tarballs of these library problems at http://webhost.math.rochester.edu/webworkdocs/librarytarballsLibrary

Additonal Problem Library Information