WeBWorK Problems

Installing the Open Problem Library

Installing the Open Problem Library

by Robin Cruz -
Number of replies: 14
Hi,
I am trying to install the Open Problem Library. I've followed the instructions in the INSTALL file which came with webwork-open-problem-library folder, but get an error message when I try to run "OPL-update":

Use of uninitialized value $WeBWorK::Constants::WEBWORK_DIRECTORY in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/Constants.pm line 38.
syntax error at /opt/webwork/webwork2/bin/OPL-update line 111, near "else"
Missing right curly or square bracket at /opt/webwork/webwork2/bin/OPL-update line 829, at end of line
Execution of /opt/webwork/webwork2/bin/OPL-update aborted due to compilation errors.
wwadmin@docralphv:/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary$ /opt/webwork/webwork2/bin/OPL-update
Use of uninitialized value $WeBWorK::Constants::WEBWORK_DIRECTORY in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/Constants.pm line 38.
syntax error at /opt/webwork/webwork2/bin/OPL-update line 111, near "else"
Missing right curly or square bracket at /opt/webwork/webwork2/bin/OPL-update line 829, at end of line
Execution of /opt/webwork/webwork2/bin/OPL-update aborted due to compilation errors.

I checked out the open problem library last week using github.
Thanks --rac

In reply to Robin Cruz

Re: Installing the Open Problem Library

by Jason Aubrey -
Hi Robin,

There was an update to the OPL-update script pushed to openwebwork/webwork2 this weekend.  Could you give that a try and let us know if it works for you.

Thanks,
Jason
In reply to Jason Aubrey

Re: Installing the Open Problem Library

by Robin Cruz -

Hi,

I tried the newer version of OPL-update and it gave me the same (or similar) error message as before. I've switched from the **-dev version to the stable version of webwork and pg. I ran this version of OPL-update with the address for the NationalProblemLibrary and it gave the errir below and then proceeded to update from the NationalProblemLibrary address. Next, I tried running OPL-update with the address for the OpenProblemLibrary in the conf files. I'm sending the error message it gave. Now, in a course, I can access problems in the library, but when I tried to do an Advanced Search, I got another error message which I've appended at the end of this note. By the way, I DID change the link in the course templates folder to the OpenProblemLibrary.

Thanks for your help --rac

-------------------Error message from running OPL-update with the address for OpenProblemLibrary in the conf files

Use of uninitialized value $WeBWorK::Constants::WEBWORK_DIRECTORY in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/Constants.pm line 38.

Undefined subroutine &main::include called at /opt/webwork/webwork2/bin/OPL-update line 102.

--------------------Error message from the Library browser doing an advanced search. After clicking on the Textbook option-----

Warning messages

Error messages

DBD::mysql::db selectall_arrayref failed: Incorrect table name '' at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 381.

Call stack

The information below can help locate the source of the problem.

  • in WeBWorK::Utils::ListingDB::getDBListings called at line 399 of /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm
  • in WeBWorK::Utils::ListingDB::countDBListings called at line 614 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel2adv called at line 431 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel called at line 799 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::make_top_row called at line 1374 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 496 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm
In reply to Robin Cruz

Re: Installing the Open Problem Library

by Arnold Pizer -
Hi Robin,

When I installed the OPL from github on the new MAA servers, I put it in the location
 /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/

Then I moved the "Textbooks" file there. i.e. in the location 
 /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary/Textbooks

Then I just ran the old NPL-update script and everything works.  I did that in July so it is possible other things have changed since then but I doubt it.  Of course running the new OPL-update script should be the way to do things.  

Also, on the MAA servers, I installed the svn version of WeBWorK and pg because I don't think the dev or "stable" versions on github are ready for production servers yet.  Hopefully that will change very soon.

Arnie
In reply to Arnold Pizer

Re: Installing the Open Problem Library

by Lars Jensen -
Hi Everyone,

Is the OPL-update script supposed to work now? We're getting similar errors to Robin when running the OPL-update script. 

As Arnie suggested, we did copy over the NPL-update script and this  seems to run OK, with only minor errors.

Lars.
In reply to Lars Jensen

Re: Installing the Open Problem Library

by Michael Gage -
Did you change the library version to 2.5 in the config files?
In reply to Michael Gage

Re: Installing the Open Problem Library

by Lars Jensen -
Hi Mike,

You mean whether I included this line in localOverrides.conf right?

$problemLibrary{version} = "2.5";

Because there is no $problemLibrary{version} =""; line in any of the config files, at first I didn't include it. Then I manually entered it in my localOverrides.conf but the script still won't run - I get this error when trying to run it:

Use of uninitialized value $WeBWorK::Constants::WEBWORK_DIRECTORY in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/Constants.pm line 38.
Undefined subroutine &main::include called at ./OPL-update line 102.

A perhaps related issue is that after running the NPL-update script I now get the error below whenever I enter the library browser. (This error wasn't there before I ran the NPL-update script.)

Lars.

Warning messages

Error messages

DBD::mysql::st execute failed: Table 'webwork.OPL_DBsubject' doesn't exist at /opt/webwork/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 243.

Call stack

The information below can help locate the source of the problem.

  • in WeBWorK::Utils::ListingDB::getAllDBsubjects called at line 486 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel2 called at line 430 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::browse_library_panel called at line 799 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::make_top_row called at line 1374 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Instructor/SetMaker.pm
  • in WeBWorK::ContentGenerator::Instructor::SetMaker::body called at line 152 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
  • in WeBWorK::Template::template called at line 496 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::content called at line 200 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
  • in WeBWorK::ContentGenerator::go called at line 371 of /opt/webwork/webwork2/lib/WeBWorK.pm
In reply to Lars Jensen

Re: Installing the Open Problem Library

by Paul Pearson -
Hi,

I think I had the same problem a few weeks ago until Jason Aubrey suggested adding or modifying a line in /opt/webwork/webwork2/conf/defaults.config to read:

$problemLibrary{version} = "2.5";

After making this change, run the OPL-update script in /opt/webwork/webwork2/bin .

The reason why having such a line in localOverrides.conf does not fix the problem is the order in which the files localOverrides.conf and defaults.config are read.

Let us know if this fixes the problem.

Good luck!

Paul Pearson

In reply to Paul Pearson

Re: Installing the Open Problem Library

by Arnold Pizer -
Hi,

The idea is that no one should ever edit defaults.config.

Does putting this in site.conf work? Maybe the OPL-update script is not getting information from localOverrides.conf? As a temporary fix putting this in defaults.conf is OK, but not as a permanent fix.

Arnie
In reply to Arnold Pizer

Re: Installing the Open Problem Library

by Jason Aubrey -
All, 

It looks like OPL-update script was looking for the problem library version in a non-existent VERSION file in the top-level libraries/ directory, but that Listing DB.pm was looking for it in $ce->{problemLibrary}->{version}.  I've updated OPL-update to get the value of $problemLibrary{version} from the course environment object $ce.  I've pushed that change to openwebwork/webwork2 on github.

In the current config files for webwork2/ in there is in defaults.config a line which sets $problemLibrary{version}="2".

Now, the config files are evaluated in this order: site.conf, defaults.config, localOverrides.conf.  If the value of a variable is set in more than one file, evaluation of the file later in the list will overwrite the value of any variables given values in files earlier in the list.

So, site.conf variables should not be repeated in the other two; for example, setting $problemLibrary{version} = "2.5" in site.conf will not have any effect since it will be trumped by the current value in defaults.config. 

Also, setting $problemLibrary{version} = "2.5" will work (now).  So, do a git pull to get the new OPL-update, and it should work as intended.

Thanks,
Jason
In reply to Jason Aubrey

Re: Installing the Open Problem Library

by Lars Jensen -
Hi Jason,

Thanks. The new OPL-update script now runs. There still is an error message:

Use of uninitialized value $WeBWorK::Constants::WEBWORK_DIRECTORY in concatenation (.) or string at /opt/webwork/webwork2/lib/WeBWorK/Constants.pm line 38.

but things seem to work nevertheless. One last question: mathjax is no longer in the webwork2/ directory - I had to download that separately. Is this what I'm expected to do?

Thanks,
Lars.
In reply to Lars Jensen

Re: Installing the Open Problem Library

by Jason Aubrey -
It's still there but in git you have to pull it down a little differently.  In theory the command

git submodule update --init

executed from webwork2/ should pull down MathJax, at least that's how I set it up.  But now I'm getting an error message 

No submodule mapping found in .gitmodules for path 'htdocs/themes/math2/codemirror2'

The weird thing is that .gitmodules doesn't have any entry at all for this so I'm currently stumped....I'll try to track down what the issue is and let you know.

That error message about $WeBWorK::Constants::WEBWORK_DIRECTORY, is that emitted by OPL-update?
In reply to Jason Aubrey

Re: Installing the Open Problem Library

by Lars Jensen -
Hi Jason,

Yes, that error pops up right at the start after I execute OPL-update.

Lars.
In reply to Lars Jensen

Re: Installing the Open Problem Library

by Michael Gage -
Jason,

I'm pretty sure that it is WeBWorK/Constants.pm which is complaining.  It is 
expecting that $WeBWorK::Constants::WEBWORK_DIRECTORY is defined which it usually is by webwork.apache2-config.  The command line script doesn't go through webwork.apach2-config.  You can simply initialize this variable in 
the OPL script from ENV(WEBWORK_ROOT) and that should fix the warning message.

--Mike

In reply to Michael Gage

Re: Installing the Open Problem Library

by Bill Farr -
Jason,
Mike is correct that it is WeBWorK/Constants.pm that is complaining. 
I was able to make this error go away by editing Constants.pm (temporarily)
to not use $WeBWorK::Constants::WEBWORK_DIRECTORY.

After my edit and downloading your fixes to OPL-update, I was able to run the script with no problems.

Bill