## WeBWorK Problems

### College of Idaho problems added to National Problem Library

by Arnold Pizer -
Number of replies: 19
A collection of over 700 problems from the College of Idaho have been added to the National Problem Library. These problem cover various topics in Algrbra.

If you set up the problem library following the directions in e.g. http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Ubuntu_8.04 (which has now been updated to use the National Problem Library) and you have a current version a global.conf which has the lines

$courseFiles{problibs} = { Library => "NPL Directory", (or you add the Library line to your global.conf) then when you use the Library Browser, you will see a "NPL Directory" button and if you press that you will see a list of directories one of which will be CollegeOfIdaho and all the pg files will be under that. Note that to update the National Problem Library via cvs to obtain the new collections, use the command cvs update -dP (use -dP since this allows new directories to be added -- otherwise the new CollegeOfIdaho directory won't show up.) Also since these problems require special macros, you will need to add a new item to the search list for macros in global.conf # # The macro file search path. Each directory in this list is searched # (in this order) by loadMacros() when it looks for a .pl file. #$pg{directories}{macrosPath} = [
".", # search the problem file's directory
$courseDirs{macros},$pg{directories}{macros},
'/ww/webwork/libraries/
NationalProblemLibrary/macros/Union',
'/ww/webwork/libraries/NationalProblemLibrary/macros/Dartmouth',
'/ww/webwork/libraries/NationalProblemLibrary/macros/Dartmouth/Stewart',
];

Many thanks to Robin Cruz at the College of Idaho for authoring these problems and contributing them to the National Problem Library.

Arnie

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
On trying to update the NPL, I find that I do not have the command script "NPL-update" in my bin and when I try to use the command "cvs update -dP", I get an error message telling me that I need to set CVSROOT.
My first question is should I set CVSROOT in my .bash_profile, and to what should I set it?
The second question is about the command script. Is the reason I do not have this have to do with the version of WeBWorK (2.3.2) that I am using?

Bayne

### Re: College of Idaho problems added to National Problem Library

by Arnold Pizer -
Hi Richard,

The directions were given assuming people as using WeBWorK 2.4 (see below).

You should not have a CVSROOT in your .bash_profile.
If you downloaded the library (or WeBWorK) using CVS each directory will have a CVS folder and under that a file Root which gives the CVSROOT for that directory.

For example if you downloaded and installed the National Problem library following the directions http://webwork.maa.org/wiki/Installation_Manual_for_2.4_on_Ubuntu_8.04 then you will have the directory

/opt/webwork/libraries/NationalProblemLibrary/

If you cd into this NationalProblemLibrary direction and then issue the command
"cvs update -dP" the update should proceed.

The script "NPL-update" was added in WeBWorK 2.4 so that is the reason you don't have this.

The Utah problems will probably all work fine with WeBWorK 2.3 since I don't think they use mathobjects. However many of the new problems use mathobjects (I think this is true of most of the College of Idaho problems) and for these you probably need WeBWorK 2.4.

Arnie

### Re: College of Idaho problems added to National Problem Library

by Davide Cervone -
MathObjects should work fine with WeBWorK 2.3. You can update pg to 2.4 while leaving WeBWorK at 2.3 (I was doing this during most of the development of MathObjects). You probably DO want to update to pg 2.4 rather than stay at pg 2.3, since there are a number of important updates there, and some of the College of Idaho problems require the new features.

Davide

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
Arnie, Davide,
Thank you for the responses. Now:

1. Yes, I have had no trouble with MathObjects and have several problems using it, though it's called using Parser.pl.

2. Though I do not have a library directory NationalProblemLibrary, I do have a directory called database_problems. I do have a file called ProblemLibrary, but it is just a link to the database_problems directory. If I do my CVS in the database_problems directory, will I be able to get a sufficient update or do I have to do more complicated stuff?

3. I will try to upgrade to pg 2.4

### Re: College of Idaho problems added to National Problem Library

by Davide Cervone -
If you stick with pg 2.3, you may need to create a file in pg/macros called MathObject.pl and have it contain the line
    loadMacros("Parser.pl");

That should not be necessary if you update to pg 2.4 as it will already contain such a file.

The database_problems directory is the right place to do the cvs update. This will get you the files, but will not add them to the database used by the Library Manager, so they will not appear in the categorized listings. The NPL-update command is what adds them to that list, but it is not available in webwork 2.3. There was an older version of this called loadDB2or loadDB2-deprecated that should be in your database_problems directory. Try running that to update the database instead.

Davide

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
Hello again,
As Lars also indicated, I was able to use the cvs update and did receive the Utah problems, but not the CollegeOfIdaho ones.
Bayne

### Re: College of Idaho problems added to National Problem Library

by Lars Jensen -
Hi Richard,

The problem is that I was using the old library structure. To fix this, read the instructions here, and download the library from cvs accordingly:

http://webwork.maa.org/wiki/National_Problem_Library

Please note that there is a typo in second symbolic link in the instructions - it should be database_problems - not database-problib:

\$ ln -s /opt/webwork/libraries/NationalProblemLibrary /opt/webwork/libraries/database_problems

Lars.

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
Lars,
Thanks. I have now successfully added the National Problem Library including the CollegeOfIdaho problems. I have also included the Idaho macros in my macro search path. Unfortunately, I still get error messages when I try to run several of the problems from that library. The indication usually comes from not being able to find some context file. I thought that these would be included in MathObjects. For example, one error message follows:

Unknown context 'ScientificNotation' in Parser::Context::current at line 42 of [PG]/macros/Parser.pl in main::Context at line 35 of [PG]/macros/Parser.pl in (eval) at line 1 of [PG]/macros/Parser.pl in main::__ANON__ at line 236 of /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Safe.pm in (eval) at line 236 of /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Safe.pm in Safe::reval at line 904 of [PG]/lib/WeBWorK/PG/Translator.pm in WeBWorK::PG::Translator::translate at line 344 of [WW]/lib/WeBWorK/PG/Local.pm in WeBWorK::PG::Local::new_helper at line 65 of [WW]/lib/WeBWorK/PG/Local.pm in (eval) at line 65 of [WW]/lib/WeBWorK/PG/Local.pm in WeBWorK::PG::Local::new at line 52 of [WW]/lib/WeBWorK/PG.pm in WeBWorK::PG::new at line 616 of [WW]/lib/WeBWorK/ContentGenerator/Problem.pm in WeBWorK::ContentGenerator::Problem::pre_header_initialize at line 169 of [WW]/lib/WeBWorK/ContentGenerator.pm in WeBWorK::ContentGenerator::go at line 338 of [WW]/lib/WeBWorK.pm in WeBWorK::dispatch at line 115 of [WW]/lib/Apache/WeBWorK.pm in (eval) at line 115 of [WW]/lib/Apache/WeBWorK.pm in Apache::WeBWorK::handler at line 0 of [PG]/macros/Parser.pl in (eval) at line 0 of [PG]/macros/Parser.pl Died within main::Context called at line 35 of [TMPL]/tmpEdit/Library/NationalProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg

Bayne

### Re: College of Idaho problems added to National Problem Library

by Lars Jensen -
Hi Richard,

Those errors don't look like they are related to your installation of the NPL. I do get errors from 15-20% of the CollegeOfIdaho problems. I went through all the sets, and I have included samples of all the error messages below. They look like they mostly have to do with missing macro packages. The most common problems were the undefined NchooseK subroutine, and missing PGnauGraphics macros. The list below is a pretty complete list of all the errors from the sets of CollegeOfIdaho problems:

You can look up the location of many macros by following
Databases->PG macros reference from the left margin of the wiki.

Undefined subroutine &main::NchooseK called at line 33 of [TMPL]/Library/CollegeOfIdaho/setAlgebra_01_02_OperationsWithRealNumbers/12IntAlg_12_OperationsWithReals.pg

in PGchoicemacros.pl -- this file may not be listed in the "loadMacros"
section at the top of the problem.

Undefined subroutine &main::new_pop_up_select_list called at line 52 of [TMPL]/Library/CollegeOfIdaho/setAlgebra_01_01_AlgebraicExpressions/11IntAlg_09_AlgebraicExpressions.pg

in PGchoicemacros.pl -- this file may not be listed in the "loadMacros"
section at the top of the problem.

Can't locate macro file |PGnauGraphics.pl| via path: |.|, |/opt/webwork/courses/testinglj/templates/macros|, |/opt/webwork/pg/macros|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Union|, |/opt/webwork/libraries/NationalProblemLibrary/macros/CollegeOfIdaho|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Dartmouth|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Michigan| at line 310 of (eval 1295) Died within main::loadMacros called at line 19 of [TMPL]/Library/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_15_ScientificNot.pg

The Northern Arizona University problems and macros are not yet in the NationalProblemLibrary.
Undefined subroutine &main::new_match_list called at line 38 of [TMPL]/Library/CollegeOfIdaho/setAlgebra_02_02_AlgebraOfFunctions/22IntAlg_03a_functOperation.pg

in PGchoicemacros.pl -- this file may not be listed in the "loadMacros"
section at the top of the problem.

I don't recognize the cause of the remaining errors below.

Can't locate macro file |PGaciRemoveCommas.pl| via path: |.|, |/opt/webwork/courses/testinglj/templates/macros|, |/opt/webwork/pg/macros|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Union|, |/opt/webwork/libraries/NationalProblemLibrary/macros/CollegeOfIdaho|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Dartmouth|, |/opt/webwork/libraries/NationalProblemLibrary/macros/Michigan| at line 310 of (eval 1130) Died within main::loadMacros called at line 20 of [TMPL]/Library/CollegeOfIdaho/setAlgebra_02_02_AlgebraOfFunctions/22IntAlg_17_functOperation.pg

Unknown control sequence '\hspace' setAlgebra_04_03_AbsoluteValue/43IntAlg_16_AbsValIneq.pg

Unknown control sequence '\hspace' setAlgebra_04_03_AbsoluteValue/43IntAlg_17_AbsValIneq.pg

Unknown control sequence '\hspace' setAlgebra_04_03_AbsoluteValue/43IntAlg_18_AbsValIneq.pg

Use of uninitialized value in array element at line 54 of /opt/webwork/libraries/NationalProblemLibrary/macros/Union/unionInclude.pl

Lars.

(Edited by Michael Gage - original submission Thursday, 25 September 2008, 03:44 PM)

### Re: College of Idaho problems added to National Problem Library

by Lars Jensen -
Hi Arnie,

The cvs update (cvs update -dP ) doesn't download any problems from CollegeOfIdaho for us either. The Utah directory, on the other hand, is correctly created, and those problems download fine. Is the CollegeOfIdaho directory accessible to anonymous cvs?

Lars.

### Re: College of Idaho problems added to National Problem Library

by Robin Cruz -
Lars,

I looked over the list of errors you posted.  A couple of the problems were "old" ones that I missed deleting from the final package I sent for posting.  For example, these two should be deleted:

[TMPL]/Library/CollegeOfIdaho/setAlgebra_02_02_AlgebraOfFunctions/22IntAlg_03a_functOperation.pg

[TMPL]/Library/CollegeOfIdaho/setAlgebra_02_02_AlgebraOfFunctions/22IntAlg_17_functOperation.pg

The "\hspace" problem also escaped me.  I thought I had caught them all.  This is not a problem if you are viewing the problem in "image" mode but it causes an error in "jsmath" mode.

For the errors involving "NchooseK", "new_pop_up_select_list", I'm not sure what to do.  They are in the PGchoicemacros.pl file as Mike mentions, but PGchoicemacros.pl is one of the files loaded by PGstandard.pl -- which is loaded in these problems.  For "PGnauGraphics.pl", perhaps I should put it in our macros file and send it to Mike Gage to replace the ones I sent?  or is there a way I can add/delete files in the CVS from my end?

Thanks, Lars for finding these difficulties.

--rac

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
Robin,
I was just wondering if you could give me a clue on what to look for to overcome either of the following two messages.

Error detected while loading /opt/webwork/libraries/NationalProblemLibrary/macros/CollegeOfIdaho/CofIdaho_macros.pl: syntax error at line 1 of /opt/webwork/libraries/NationalProblemLibrary/macros/CollegeOfIdaho/CofIdaho_macros.pl, near "; =" Died within main::compile_file called at line 270 of (eval 938) from within main::loadMacros called at line 20 of [TMPL]/Library/NationalProblemLibrary/CollegeOfIdaho/setAlgebra_05_06_Factoring/56IntAlg_01_Factor.pg

---

Can't locate macro file |contextScientificNotation.pl| via path: |.|, |/opt/webwork/courses/MATH-007bayne/templates/macros|, |/opt/webwork/pg/macros|, |/opt/webwork/libraries/union_problib/macros|, |opt/webwork/libraries/union_problib/parserOrientation|, |/opt/webwork/libraries/NationalProblemLibrary/macros/CollegeOfIdaho| at line 272 of [PG]/macros/dangerousMacros.pl Died within main::loadMacros called at line 19 of [TMPL]/Library/NationalProblemLibrary/CollegeOfIdaho/setAlgebra_01_07_ScientificNotation/17IntAlg_01_ScientificNot.pg

### ---

Unknown context 'LimitedPolynomial-Strict' in Parser::Context::current at line 42 of [PG]/macros/Parser.pl in main::Context at line 31 of [PG]/macros/Parser.pl in (eval) at line 1 of [PG]/macros/Parser.pl in main::__ANON__ at line 236 of /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Safe.pm in (eval) at line 236 of /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Safe.pm in Safe::reval at line 904 of [PG]/lib/WeBWorK/PG/Translator.pm in WeBWorK::PG::Translator::translate at line 344 of [WW]/lib/WeBWorK/PG/Local.pm in WeBWorK::PG::Local::new_helper at line 65 of [WW]/lib/WeBWorK/PG/Local.pm in (eval) at line 65 of [WW]/lib/WeBWorK/PG/Local.pm in WeBWorK::PG::Local::new at line 52 of [WW]/lib/WeBWorK/PG.pm in WeBWorK::PG::new at line 616 of [WW]/lib/WeBWorK/ContentGenerator/Problem.pm in WeBWorK::ContentGenerator::Problem::pre_header_initialize at line 169 of [WW]/lib/WeBWorK/ContentGenerator.pm in WeBWorK::ContentGenerator::go at line 338 of [WW]/lib/WeBWorK.pm in WeBWorK::dispatch at line 115 of [WW]/lib/Apache/WeBWorK.pm in (eval) at line 115 of [WW]/lib/Apache/WeBWorK.pm in Apache::WeBWorK::handler at line 0 of [PG]/macros/Parser.pl in (eval) at line 0 of [PG]/macros/Parser.pl Died within main::Context called at line 31 of [TMPL]/Library/NationalProblemLibrary/CollegeOfIdaho/setAlgebra_05_01_IntroPolynomials/51IntAlg_14_PolyAddSub.pg

Any point in the right direction will be appreciated.

Bayne

### Re: College of Idaho problems added to National Problem Library

by Davide Cervone -
Have you updated to pg rel-2-4-patches? These are some of the new features that I mentioned to you in an earlier message. E.g., contetScientificNotation.pl is in pg/macros, but was not in version 2.3 (t was developed at the AIM conference last year, and added to pg/macros in the fall).

Davide

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
OK. I have updated my pg to 2.4 w/ patches and though there was a delay*, most of the errors were taken care of so that now the only ones I have seen remaining are mostly the aforementioned NChooseK and PGnauGraphics.pl ones.
Thanks.

Bayne

*When first I checked the problems after the update, the errors were still indicated. However, as I continued to check, they went away. I did not quite understand why that should be.

### Re: College of Idaho problems added to National Problem Library

by Davide Cervone -
It sounds like you didn't restart the server after doing the update. There are a couple of PG files that are pre-loaded as part of the persistent mod_perl process, so if you don't restart the server, the old processes would still have the older versions of those files. As the children died off and were restarted by the server, more and more of the them would have the new files, and the errors would start to go away.

Anyway, that's what it sounds like to me.

Davide

### Re: College of Idaho problems added to National Problem Library

by Richard Bayne -
Davide,
Thank you. That makes sense and thus makes me feel more comfortable. It looks like we are now ready to go using these new problems.
Bayne

### Re: College of Idaho problems added to National Problem Library

by Davide Cervone -
The PGchoicemacros.pl file was included in the original Union College version of PGstandard.pl (that is where this file came from), but when it was added to the pg/macros directory, PGchoicemacros.pl (and also PGgraphmacros.pl) where removed from it. That means that any files that depend on those two macro files being loaded by PGstandard.pl will fail using the "official" version of PGstandard.pl. A number of Union's problems fall into that category.

The best thing to do, I guess, is to go back and add PGchoicemacros.pl (and PGgraphmacros.pl) to those that use them. We still have to do that to the Union problems.

Davide

### Re: College of Idaho problems added to National Problem Library

by Arnold Pizer -
Hi Lars,

I'll bet you were in database_problems/ rather than NationalProblemLibrary/
(NPL).

The Utah problems are in both locational but only those in the NPL will be maintained. The College of Idaho problems are only in the NPL.

Follow the instructions for installing the NPL

Arnie

### Re: College of Idaho problems added to National Problem Library

by Robin Cruz -

Three items:

First:

Lars and Richard,  I have updated the College of Idaho problems with (I hope) all the macros they need loaded, and I have fixed a few bugs.  If you update your copies of the problems from the CVS, would you let me know if you find more issues?

Second:

One of the macros I used for randomizing the problems with def files, unionInclude.pl, seems to be different from the version I used last year.  It has a date of May 31, 2006 on it in the macros/Union folder, but Davide modified it for me in 2007 so that it would scramble a subset of problems within a def file.  I have a copy of the 2007 version in my back-up files.  If I put that file in the College of Idaho macros in the National Library, will it be used in the Idaho problems or will the one in the Union macros directory be used?  Currently they have the same name.  Perhaps it doesn't matter -- I don't know if anyone will use the def files in the College of Idaho folder -- maybe I should just remove them?

--rac