Difference between revisions of "Open Problem Library"

From WeBWorK_wiki
Jump to navigation Jump to search
 
(40 intermediate revisions by 7 users not shown)
Line 1: Line 1:
  +
This page describes the OpenProblemLibrary (OPL). The Open Problem Library was previously called the National Problem Library. We have changed the name on most pages but you may still see references to OPL's earlier incarnation as the NPL.
   
 
  +
<!--
 
{{ Warning | The National Problem Library (NPL) has been renamed to the WeBWorK Open Problem Library (OPL for short) to
 
{{ Warning | The National Problem Library (NPL) has been renamed to the WeBWorK Open Problem Library (OPL for short) to
   
 
reflect that it will soon contain content from many countries and in many languages. Until we get all of the instructions cleaned up these instructions may not work quite as advertised. }}
 
reflect that it will soon contain content from many countries and in many languages. Until we get all of the instructions cleaned up these instructions may not work quite as advertised. }}
  +
-->
   
 
  +
The WeBWorK Open Problem Library (OPL) contains problems contributed by faculty from many institutions that have used WeBWorK. Currently, there are approximately 35,000 problems in the OPL, and new problems are added regularly. The OPL was initially formed from several of the original [[Problem Libraries|File Based Problem Libraries]], and includes all of the problems from the Arizona State, Rochester, California State-Long Beach, and the University of Virginia libraries. It also contains most, if not all, of the problems from Union College, the College of New Jersey, Dartmouth, Ohio State, Northern Arizona University, and Indiana University. Once known as the National Problem Library (NPL), the Open Problem Library (OPL) naming convention was adopted in the summer of 2012 to accommodate the increasing internationalization of WeBWorK and the possible inclusion of problem libraries from textbook publishers.
The WeBWorK Open Problem Library (OPL) contains problems contributed by faculty from many institutions that have used WeBWorK. Currently, there are approximately 25,000 problems in the OPL, and new problems are added regularly. The OPL was initially formed from several of the original [[Problem Libraries|File Based Problem Libraries]], and includes all of the problems from the Arizona State, Rochester, California State-Long Beach, and the University of Virginia libraries. It also contains most, if not all, of the problems from Union College, the College of New Jersey, Dartmouth, Ohio State, Northern Arizona University, and Indiana University. Once known as the National Problem Library (NPL), the Open Problem Library (OPL) naming convention was adopted in the summer of 2012 to accommodate the increasing internationalization of WeBWorK and the possible inclusion of problem libraries from textbook publishers.
 
   
 
In addition to merging problem collections from multiple institutions into a single collection, WeBWorK provides a different interface to these problems. Problems in the OPL are marked internally with metadata, 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, or section. To a limited extent, problems have been indexed against sections of textbooks, in which case instructors can also search for problems on that basis. WeBWorK stores this information in a database, so part of the installation involves loading metadata into the database.
 
In addition to merging problem collections from multiple institutions into a single collection, WeBWorK provides a different interface to these problems. Problems in the OPL are marked internally with metadata, 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, or section. To a limited extent, problems have been indexed against sections of textbooks, in which case instructors can also search for problems on that basis. WeBWorK stores this information in a database, so part of the installation involves loading metadata into the database.
   
Faculty from institutions using WeBWorK [[Submitting problems to the OPL |are invited]] to submit new problems to the OPL. The OPL is one of the most popular features of WeBWorK, and its value is based on the many excellent contributions that have been recieved.
+
Faculty from institutions using WeBWorK [[Submitting problems to the OPL |are invited]] to submit new problems to the OPL. Submissions are reviewed by members of the OPL [[OPL Editorial Board]] which maintains the OPL. The OPL is one of the most popular features of WeBWorK, and its value is based on the many excellent contributions that have been received.
  +
  +
== License ==
  +
Unless otherwise indicated, copyrights on the content contributed to the WeBWorK Open Problem Library are held by the
  +
author(s) of that content. This includes the problem files (*.pg) and any associated auxililary files such as images and
  +
custom macro files.
  +
  +
Unless otherwise indicated, all contributions to the WeBWorK Open Problem Library are licensed under the
  +
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
  +
To view a copy of this license, visit
  +
http://creativecommons.org/licenses/by-nc-sa/3.0/
  +
  +
See license on github site for more details:
  +
https://github.com/openwebwork/webwork-open-problem-library/blob/main/OPL_LICENSE
  +
  +
== Browsing the OPL ==
  +
  +
Log into a WeBWorK course and select '''Library Browser''' from the links menu. On the resulting screen, click the '''Open Problem Library''' button. This allows you to browse the library by a taxonomy of mathematics. For more refined searches, one can restrict to problems which have been marked as going with a particular section of a textbook, or to certain [[Problem_Levels|Bloom's taxonomy-type levels]].
  +
  +
One can add a stanza in the <code>localOverrides.conf</code> file to obtain an "OPL Directory" button which will enable you to browse the Open Problem Library subdirectories directly.
  +
This lets you see problems based on the institution from which they came.
  +
  +
You can also add a button for the "Contrib" library which contains problems contributed to the OPL but not yet curated and added to the OPL itself. In order to enable
  +
the Contrib button you will need to create, from the command line a link to the Contrib directory from templates directory of each course for which the button is to appear.
  +
  +
# In myCourse/templates
  +
sudo ln -s /opt/webwork/libraries/webwork-open-problem-library/Contrib Contrib
  +
  +
ls -l Contrib
  +
Contrib -> /opt/webwork/libraries/webwork-open-problem-library/Contrib
  +
  +
  +
  +
# Additional library buttons can be added to the Library Browser (SetMaker.pm)
  +
# by adding the libraries you want to the following line. For each key=>value
  +
# in the list, if a directory (or link to a directory) with name 'key' appears
  +
# in the templates directory, then a button with name 'value' will be placed at
  +
# the top of the problem browser. (No button will appear if there is no
  +
# directory or link with the given name in the templates directory.) For
  +
# example,
  +
#
  +
# $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"};
  +
#
  +
# would add two buttons, one for the Rochester library and one for the ASU
  +
# library, provided templates/rochester and templates/asu exists either as
  +
# subdirectories or links to other directories. The "OPL Directory" button
  +
# activated below gives access to all the sub directories in the Open
  +
# Problem Library.
  +
#
  +
$courseFiles{problibs} = {
  +
Library => "OPL Directory",
  +
# rochesterLibrary => "Rochester",
  +
# asuLibrary => "Arizona State",
  +
# dcdsLibrary => "Detroit CDS",
  +
# dartmouthLibrary => "Dartmouth",
  +
# indianaLibrary => "Indiana",
  +
# osuLibrary => "Ohio State",
  +
# capaLibrary => "CAPA",
  +
# ucsbLibrary => "UCSB"
  +
};
   
 
== Obtaining the OPL ==
 
== Obtaining the OPL ==
   
The Open Problem Library can be checked out from the WeBWorK Subversion repository via
+
The Open Problem Library can be checked out from the WeBWorK GitHub repository via
 
<!-- {{SVN checkout|repo=npl|branch=trunk|dir=NationalProblemLibrary}}-->
 
<!-- {{SVN checkout|repo=npl|branch=trunk|dir=NationalProblemLibrary}}-->
 
cd /opt/webwork/libraries
 
cd /opt/webwork/libraries
  +
sudo git clone <nowiki>https://github.com/openwebwork/webwork-open-problem-library.git</nowiki>
   
sudo git clone <nowiki>https://github.com/openwebwork/webwork-open-problem-library.git</nowiki>.
 
  +
You may or may not need to use <code>sudo</code> depending on the permissions assigned to the libraries directory.
   
You may or may not need to use sudo depending on the permissions assigned to the libraries directory.
 
  +
Insure that the permissions are set so that the WeBWorK server can read the files in the OpenProblemLibrary.
   
Insure that the permissions are set so that the webwork server can read the files in the OpenProblemLibrary.
 
  +
<code>git</code> is a command that is already installed on most Unix systems. If not, there are standard simple instructions for installing it on your platform available via google search.
 
git is a command that is already installed on most unix systems. If not there are standard simple instructions for installing it on your platform available via google search.
 
   
 
== Installing the OPL ==
 
== Installing the OPL ==
   
  +
<!--
 
This section assumes you have an otherwise working WeBWorK installation. The standard [[:Category:Installation Manuals|Installation instructions]] recommend WeBWorK be installed into <tt>/opt/webwork</tt>, and the instuctions here assume that location. In fact, if you are installing WeBWorK for the first time, we recommend that you install the OPL using [[:Category:Installation Manuals|those instructions]], which provide more context and may be easier to follow.
 
This section assumes you have an otherwise working WeBWorK installation. The standard [[:Category:Installation Manuals|Installation instructions]] recommend WeBWorK be installed into <tt>/opt/webwork</tt>, and the instuctions here assume that location. In fact, if you are installing WeBWorK for the first time, we recommend that you install the OPL using [[:Category:Installation Manuals|those instructions]], which provide more context and may be easier to follow.
  +
-->
   
 
Assuming the rest of WeBWorK is in <code>/opt/webwork/</code> proceed as follows to install the OPL. First, make sure you have an <code>/opt/webwork/libraries</code> directory:
 
Assuming the rest of WeBWorK is in <code>/opt/webwork/</code> proceed as follows to install the OPL. First, make sure you have an <code>/opt/webwork/libraries</code> directory:
 
  +
<code>mkdir -p /opt/webwork/libraries</code>
<code> $ mkdir -p /opt/webwork/libraries</code>
 
 
 
The OPL can be downloaded from the <code> OPL </code> github.com repository directly into the library directory. It creates a directory called <code>webwork-open-problem-library</code>
 
The OPL can be downloaded from the <code> OPL </code> github.com repository directly into the library directory. It creates a directory called <code>webwork-open-problem-library</code>
 
containing the library. The full path to the library will be <code>/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary</code>. This is the library address that should be included in <code>webwork2/conf/localOverrides.conf</code>.
 
containing the library. The full path to the library will be <code>/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary</code>. This is the library address that should be included in <code>webwork2/conf/localOverrides.conf</code>.
  +
<code>cd /opt/webwork/libraries</code>
  +
<code>sudo git clone https://github.com/openwebwork/webwork-open-problem-library.git.</code>
  +
<!-- <code>$ {{SVN checkout|repo=npl|branch=trunk|dir=NationalProblemLibrary}}<code> -->
  +
For backwards compatibility one can create symbolic links to:
   
  +
<code>ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary /opt/webwork/libraries/NationalProblemLibrary</code>
   
<code>$ cd /opt/webwork/libraries</code>
 
  +
Alternatively one can update the <code>Library</code> link in each course <code>courseName/templates/Library</code>. This requires
  +
more work but is a better solution in the long run. It can be done with a script.
   
<code>$ {{SVN checkout|repo=npl|branch=trunk|dir=NationalProblemLibrary}}<code>
 
  +
Depending on your previous setup, you may have to create additional symbolic links from the previous
  +
locations of libraries to the current ones. In particular, the popular file libraries are now contained
  +
in the National Problem Library, so you may need links such as
  +
ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/Rochester /opt/webwork/libraries/rochesterLibrary
  +
at least in the short run to keep older set definition files working.
   
 
  +
== Updating the OPL ==
   
  +
The git repository for the OPL is updated as problems are added, additional metadata is added, or problem bugs are fixed. So, it is a good idea to update your copy of the OPL periodically, say once per semester.
   
For backwards compatibility one can create symbolic links to:
 
  +
To update, run the <code>git pull</code> command to download the latest versions from our server. Then, re-run <code>OPL-update</code>.
   
$ ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary /opt/webwork/libraries/NationalProblemLibrary
+
$ cd /opt/webwork/libraries/webwork-open-problem-library
  +
$ git pull
  +
$ OPL-update
  +
Library version is 2.5; using OPLtables!
  +
Mysql database reinitialized.
  +
Reading in textbook data from Textbooks in the library /opt/webwork/libraries/OPL.
  +
Reading in OPL taxonomy from Taxonomy in the library /opt/webwork/libraries/OPL.
  +
Converting data from tagged pgfiles into mysql.
  +
Number of files processed:
  +
100 200 300 400 500 600 700 800 900 1000
  +
1100 1200 1300 1400 1500 1600 1700 ...
  +
  +
$
   
Alternatively one can update the <code>Library</code> link in each course <code>courseName/templates/Library</code>. This requires
 
  +
= Contributing to the OPL =
   
more work but is a better solution in the long run.
 
  +
If you have written new problems, you might like to contribute them to the OPL so others can benefit from them as well.
   
  +
* [[Tagging Problems]]
  +
* [[Submitting problems to the OPL]]
  +
* [[Information for OPL maintainers]]
  +
* [[OPL Editorial Board]]
   
Depending on your previous setup, you may have to create additional symbolic links from the previous
 
  +
== See also ==
locations of libraries to the current ones. In particular, the popular file libraries are now contained
 
  +
in the National Problem Library, so you may need links such as
 
  +
* [[What to do if you find a bug in a problem]]
$ ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/Rochester /opt/webwork/libraries/rochesterLibrary
 
  +
at least in the short run to keep older set definition files working.
 
  +
[[Category:Problem Libraries]]
  +
[[Category:Open Problem Library]]
   
  +
= Legacy instructions =
   
 
== For WeBWorK 2.6 (or ww2.5.1.1) and later ==
 
== For WeBWorK 2.6 (or ww2.5.1.1) and later ==
Line 70: Line 87:
   
 
$problemLibrary{root} ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
 
$problemLibrary{root} ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
 
 
$problemLibrary{version} ="2.5";
 
$problemLibrary{version} ="2.5";
   
Line 78: Line 94:
   
 
cd /opt/webwork/webwork2/bin/
 
cd /opt/webwork/webwork2/bin/
 
 
./OPL-update
 
./OPL-update
   
   
 
  +
(You will need to have defined <code> WEBWORK_ROOT </code> in your shell environment.)
(You will need to have defined <code> WEBWORK_ROOT </code> in your preferences file.)
 
   
   
Line 113: Line 127:
   
 
|}
 
|}
 
  +
== Versions earlier than release 2.6 (or ww2.5.1.1) ==
= Versions earlier than release 2.6 (or ww2.5.1.1) =
 
   
   
   
 
Upgrade to release 2.6. Seriously!
 
Upgrade to release 2.6. Seriously!
 
   
   
 
Release 2.6 (renamed from ww2.5.1.1) has been in wide spread use for more than a year. You should definitely consider
 
Release 2.6 (renamed from ww2.5.1.1) has been in wide spread use for more than a year. You should definitely consider
 
 
updating to 2.6. In particular this version contains redesigned configuration files that allow you to upgrade to subsequent
 
updating to 2.6. In particular this version contains redesigned configuration files that allow you to upgrade to subsequent
 
 
versions such as release 2.7 with few if any modifications to the configuration files. This also allows you to backtrack to earlier
 
versions such as release 2.7 with few if any modifications to the configuration files. This also allows you to backtrack to earlier
 
 
versions if you feel you have upgraded prematurely. Version 2.7 supports essayQuestions among other enhancements. Both version
 
versions if you feel you have upgraded prematurely. Version 2.7 supports essayQuestions among other enhancements. Both version
 
 
2.6 and 2.7 support achievements.
 
2.6 and 2.7 support achievements.
   
   
 
  +
If you must use an earlier version of webwork here are the '''legacy instructions'''. Good luck. :-)
== Legacy instructions ==
 
 
 
 
If you must use an earlier version of webwork here are the legacy instructions:
 
 
   
 
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.)
 
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.)
Line 217: Line 219:
   
 
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.
 
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.
 
== Browsing the NPL ==
 
 
Log into a WeBWorK course and select '''Library Browser''' from the links menu. On the resulting screen, click the '''National Problem Library''' button.
 
 
Add this stanza in the <code>global.conf</code> file to obtain an "NPL Directory" button which will enable you to
 
browse the NationalProblemLibrary subdirectories.
 
 
# Additional library buttons can be added to the Library Browser (SetMaker.pm)
 
# by adding the libraries you want to the following line. For each key=>value
 
# in the list, if a directory (or link to a directory) with name 'key' appears
 
# in the templates directory, then a button with name 'value' will be placed at
 
# the top of the problem browser. (No button will appear if there is no
 
# directory or link with the given name in the templates directory.) For
 
# example,
 
#
 
# $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"};
 
#
 
# would add two buttons, one for the Rochester library and one for the ASU
 
# library, provided templates/rochester and templates/asu exists either as
 
# subdirectories or links to other directories. The "NPL Directory" button
 
# activated below gives access to all the sub directories in the National
 
# Problem Library.
 
#
 
$courseFiles{problibs} = {
 
Library => "NPL Directory",
 
# rochesterLibrary => "Rochester",
 
# asuLibrary => "Arizona State",
 
# dcdsLibrary => "Detroit CDS",
 
# dartmouthLibrary => "Dartmouth",
 
# indianaLibrary => "Indiana",
 
# osuLibrary => "Ohio State",
 
# capaLibrary => "CAPA",
 
# ucsbLibrary => "UCSB"
 
};
 
   
 
== Updating the NPL ==
 
== Updating the NPL ==
Line 266: Line 233:
 
Converting data from tagged pgfiles into mysql.
 
Converting data from tagged pgfiles into mysql.
 
$
 
$
 
== Contributing to the NPL ==
 
 
If you have written new problems, you might like to contribute them to the NPL so others can benefit from them as well.
 
 
* [[Tagging Problems]]
 
* [[Submitting problems to the NPL]]
 
* [[Information for OPL maintainers]]
 
 
== See also ==
 
 
* [[What to do if you find a bug in a problem]]
 
 
[[Category:Problem Libraries]]
 
[[Category:National Problem Library]]
 

Latest revision as of 11:51, 18 July 2022

This page describes the OpenProblemLibrary (OPL). The Open Problem Library was previously called the National Problem Library. We have changed the name on most pages but you may still see references to OPL's earlier incarnation as the NPL.


The WeBWorK Open Problem Library (OPL) contains problems contributed by faculty from many institutions that have used WeBWorK. Currently, there are approximately 35,000 problems in the OPL, and new problems are added regularly. The OPL was initially formed from several of the original File Based Problem Libraries, and includes all of the problems from the Arizona State, Rochester, California State-Long Beach, and the University of Virginia libraries. It also contains most, if not all, of the problems from Union College, the College of New Jersey, Dartmouth, Ohio State, Northern Arizona University, and Indiana University. Once known as the National Problem Library (NPL), the Open Problem Library (OPL) naming convention was adopted in the summer of 2012 to accommodate the increasing internationalization of WeBWorK and the possible inclusion of problem libraries from textbook publishers.

In addition to merging problem collections from multiple institutions into a single collection, WeBWorK provides a different interface to these problems. Problems in the OPL are marked internally with metadata, 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, or section. To a limited extent, problems have been indexed against sections of textbooks, in which case instructors can also search for problems on that basis. WeBWorK stores this information in a database, so part of the installation involves loading metadata into the database.

Faculty from institutions using WeBWorK are invited to submit new problems to the OPL. Submissions are reviewed by members of the OPL OPL Editorial Board which maintains the OPL. The OPL is one of the most popular features of WeBWorK, and its value is based on the many excellent contributions that have been received.

License

Unless otherwise indicated, copyrights on the content contributed to the WeBWorK Open Problem Library are held by the author(s) of that content. This includes the problem files (*.pg) and any associated auxililary files such as images and custom macro files.

Unless otherwise indicated, all contributions to the WeBWorK Open Problem Library are licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

See license on github site for more details: https://github.com/openwebwork/webwork-open-problem-library/blob/main/OPL_LICENSE

Browsing the OPL

Log into a WeBWorK course and select Library Browser from the links menu. On the resulting screen, click the Open Problem Library button. This allows you to browse the library by a taxonomy of mathematics. For more refined searches, one can restrict to problems which have been marked as going with a particular section of a textbook, or to certain Bloom's taxonomy-type levels.

One can add a stanza in the localOverrides.conf file to obtain an "OPL Directory" button which will enable you to browse the Open Problem Library subdirectories directly. This lets you see problems based on the institution from which they came.

You can also add a button for the "Contrib" library which contains problems contributed to the OPL but not yet curated and added to the OPL itself. In order to enable the Contrib button you will need to create, from the command line a link to the Contrib directory from templates directory of each course for which the button is to appear.

# In myCourse/templates
 sudo ln -s /opt/webwork/libraries/webwork-open-problem-library/Contrib Contrib

 ls -l Contrib
 Contrib -> /opt/webwork/libraries/webwork-open-problem-library/Contrib


# Additional library buttons can be added to the Library Browser (SetMaker.pm)
# by adding the libraries you want to the following line.  For each key=>value
# in the list, if a directory (or link to a directory) with name 'key' appears
# in the templates directory, then a button with name 'value' will be placed at
# the top of the problem browser.  (No button will appear if there is no
# directory or link with the given name in the templates directory.)  For
# example,
# 
#     $courseFiles{problibs} = {rochester => "Rochester", asu => "ASU"};
# 
# would add two buttons, one for the Rochester library and one for the ASU
# library, provided templates/rochester and templates/asu exists either as 
# subdirectories or links to other directories. The "OPL Directory" button
# activated below gives access to all the sub directories in the Open 
# Problem Library.
# 
    $courseFiles{problibs}    = {
         Library          => "OPL Directory",
       #       rochesterLibrary => "Rochester", 
       #       asuLibrary       => "Arizona State",
       # 	dcdsLibrary      => "Detroit CDS",
       # 	dartmouthLibrary => "Dartmouth",
       # 	indianaLibrary   => "Indiana",
       # 	osuLibrary       => "Ohio State",	
       #	capaLibrary      => "CAPA",
       #	ucsbLibrary        => "UCSB"
   };

Obtaining the OPL

The Open Problem Library can be checked out from the WeBWorK GitHub repository via

 cd /opt/webwork/libraries
 sudo git clone https://github.com/openwebwork/webwork-open-problem-library.git

You may or may not need to use sudo depending on the permissions assigned to the libraries directory.

Insure that the permissions are set so that the WeBWorK server can read the files in the OpenProblemLibrary.

git is a command that is already installed on most Unix systems. If not, there are standard simple instructions for installing it on your platform available via google search.

Installing the OPL

Assuming the rest of WeBWorK is in /opt/webwork/ proceed as follows to install the OPL. First, make sure you have an /opt/webwork/libraries directory:

 mkdir -p /opt/webwork/libraries

The OPL can be downloaded from the OPL github.com repository directly into the library directory. It creates a directory called webwork-open-problem-library containing the library. The full path to the library will be /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary. This is the library address that should be included in webwork2/conf/localOverrides.conf.

cd /opt/webwork/libraries
sudo git clone https://github.com/openwebwork/webwork-open-problem-library.git.

For backwards compatibility one can create symbolic links to:

  ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary /opt/webwork/libraries/NationalProblemLibrary

Alternatively one can update the Library link in each course courseName/templates/Library. This requires more work but is a better solution in the long run. It can be done with a script.

Depending on your previous setup, you may have to create additional symbolic links from the previous locations of libraries to the current ones. In particular, the popular file libraries are now contained in the National Problem Library, so you may need links such as

ln -s /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/Rochester /opt/webwork/libraries/rochesterLibrary

at least in the short run to keep older set definition files working.

Updating the OPL

The git repository for the OPL is updated as problems are added, additional metadata is added, or problem bugs are fixed. So, it is a good idea to update your copy of the OPL periodically, say once per semester.

To update, run the git pull command to download the latest versions from our server. Then, re-run OPL-update.

$ cd /opt/webwork/libraries/webwork-open-problem-library
$ git pull
$ OPL-update
Library version is 2.5; using OPLtables!
Mysql database reinitialized.
Reading in textbook data from Textbooks in the library /opt/webwork/libraries/OPL.
Reading in OPL taxonomy from Taxonomy in the library /opt/webwork/libraries/OPL.
Converting data from tagged pgfiles into mysql.
Number of files processed:
  100   200   300   400   500   600   700   800   900  1000
 1100  1200  1300  1400  1500  1600  1700 ...

$

Contributing to the OPL

If you have written new problems, you might like to contribute them to the OPL so others can benefit from them as well.

See also

Legacy instructions

For WeBWorK 2.6 (or ww2.5.1.1) and later

Modify configuration file and run update

Enter the path to the OpenProblemLibrary into the config file webwork2/conf/localOverrides.conf and set the library version number to 2.5


 $problemLibrary{root}        ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
 $problemLibrary{version}     ="2.5";


Then run webwork2/bin/OPL-update from the command line to update the meta-data for the current collection of problems in the library.

 cd /opt/webwork/webwork2/bin/
 ./OPL-update


(You will need to have defined WEBWORK_ROOT in your shell environment.)


Configuring your shell in order to run OPL-update from the command line

To make working with WeBWorK easier, there are a couple of changes you can make to your shell environment.

Add the WeBWorK bin 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 /opt/webwork/webwork2, add the directory /opt/webwork/webwork2/bin to your path.

if your shell is put this line in this file
bash export PATH=$PATH:/opt/webwork/webwork2/bin ~/.bashrc
tcsh setenv PATH $PATH:/opt/webwork/webwork2/bin ~/.cshrc

Set the WEBWORK_ROOT environment variable. Some command-line scripts rely on this variable to find other WeBWorK files.

if your shell is put this line in this file
bash export WEBWORK_ROOT=/opt/webwork/webwork2 ~/.bashrc
tcsh setenv WEBWORK_ROOT /opt/webwork/webwork2 ~/.cshrc

Versions earlier than release 2.6 (or ww2.5.1.1)

Upgrade to release 2.6. Seriously!


Release 2.6 (renamed from ww2.5.1.1) has been in wide spread use for more than a year. You should definitely consider updating to 2.6. In particular this version contains redesigned configuration files that allow you to upgrade to subsequent versions such as release 2.7 with few if any modifications to the configuration files. This also allows you to backtrack to earlier versions if you feel you have upgraded prematurely. Version 2.7 supports essayQuestions among other enhancements. Both version 2.6 and 2.7 support achievements.


If you must use an earlier version of webwork here are the legacy instructions. Good luck. :-)

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 since 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 NationalProblemLibrary directory. Should be /opt/webwork/libraries/NationalProblemLibrary.
$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 NationalProblemLibrary directory. Should be /opt/webwork/libraries/NationalProblemLibrary.
$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.

Updating the NPL

The SVN repository for the NPL is updated as problems are added, additional metadata 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 svn 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/NationalProblemLibrary
$ svn up
$ ./NPL-update
What is the root password for mysql? ***** (#Or the webworkWrite user, following recent installation instructions)
Mysql database reinitialized
Converting data from tagged pgfiles into mysql.
$