Forum archive 2000-2006

luoy@m... - the use of problem library, problem set

luoy@m... - the use of problem library, problem set

by Arnold Pizer -
Number of replies: 0
inactiveTopicthe use of problem library, problem set topic started 7/16/2004; 11:26:05 AM
last post 7/23/2004; 3:09:23 PM
userluoy@m... - the use of problem library, problem set  blueArrow
7/16/2004; 11:26:05 AM (reads: 2561, responses: 8)
I have downloaded rochester problem library from CVS. The problem is how I use them, like importing, creating problem set from it. I could see those library from my test course. Do I have to import them into MySQL DB? any detail instruction on this?

I also tried the instruction in http://hobbes.la.asu.edu/webwork-stuff/WW-problem-library-instructions but received following error:

Converts data from tagged pgfiles into mysql. Can't connect to data source , no database driver specified and DBI_DSN env var not set at ./loadDB.pl line 52

By looking into loadDB.pl, I found the quite possibly the code is broken because of the changes in data structure. ( it looks for $dbLayouts{sql}->{problem_library_classify}->{source};. But database.conf does not provide problem_library_classify).

Thanks.

Frank

<| Post or View Comments |>


userMichael Gage - Re: the use of problem library, problem set  blueArrow
7/16/2004; 1:00:47 PM (reads: 2793, responses: 0)
I've written a response to the FAQ at http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/ProblemLibraries

This shows how to use a directory, such as the rochester problem library as a source of problems.

Setting up the second kind of libary, using the SQL database, I will leave for John Jones to respond to.

<| Post or View Comments |>


userluoy@m... - Re: the use of problem library, problem set  blueArrow
7/16/2004; 1:34:47 PM (reads: 2828, responses: 1)
Mike, I followed your instrcution, but still received this error, and it tried to connectted to MySQL although both global.conf and course.conf specify gdbm as backend.

Error message Cannot connect to problem library database at /opt/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 43.

------------------------------------------------------------


Additonal warnings DBI connect('ProblemLibrary','webworkRead',...) failed: Access denied for user: 'webworkRead@localhost' (Using password: NO) at /opt/webwork2/lib/WeBWorK/Utils/ListingDB.pm line 41

Also I could not find the section that has $courseFiles{problibs}, as indicated in your instruction. BTW, I am using webwork PR5-trial2.

Thanks

<| Post or View Comments |>


userJohn Jones - Re: the use of problem library, problem set  blueArrow
7/16/2004; 2:24:04 PM (reads: 2809, responses: 0)
You are right that loadDB is currently incompatible with webwork. I expect the next version to not have loadDB at all, so I haven't updated it. I apologize for sending people to download it - I should have realized that it wouldn't work.

When this is resolved, I will post to the discussion board with instructions.

John

<| Post or View Comments |>


userluoy@m... - Re: the use of problem library, problem set  blueArrow
7/16/2004; 2:56:57 PM (reads: 2797, responses: 0)
I finally loaded the library to MySQL database. (I used PR4 when loading, since this a seperate process it is a not problem to swith back to my current working version PR5 Trial 2)

Mike, I am able to see the problem library now, but when I click on "try it" link, different error, about pg.

Software Error WeBWorK has encountered a software error while attempting to process this problem. It is likely that there is an error in the problem itself. If you are a student, contact your professor to have the error corrected. If you are a professor, please consut the error output below for more informaiton.

Error messages Error detected while loading /opt/pg/macros/PGchoicemacros.pl: PG_restricted_eval detected error at line 309 of file /opt/pg/macros/PGchoicemacros.pl 'require' trapped by operation mask at /usr/lib/perl5/5.8.0/strict.pm line 19, chunk 1. Compilation failed in require at /opt/pg/lib/WeBWorK/PG/Translator.pm line 76, chunk 1. BEGIN failed--compilation aborted at (eval 1436) line 4, chunk 1. The calling package is main

Error context

Problem1 ERROR caught by Translator while processing problem file:rochesterLibrary/ma112DB/set12/sw7_4_10.pg * Error detected while loading /opt/pg/macros/PGchoicemacros.pl: PG_restricted_eval detected error at line 309 of file /opt/pg/macros/PGchoicemacros.pl 'require' trapped by operation mask at /usr/lib/perl5/5.8.0/strict.pm line 19, chunk 1. Compilation failed in require at /opt/pg/lib/WeBWorK/PG/Translator.pm line 76, chunk 1. BEGIN failed--compilation aborted at (eval 1436) line 4, chunk 1. The calling package is main

<| Post or View Comments |>


userMichael Gage - Re: the use of problem library, problem set  blueArrow
7/16/2004; 4:09:26 PM (reads: 3105, responses: 0)
The section containing $courseFiles is relatively new. It will only work if you are using the latest versions of webwork2.0 (I recommend connecting your installation to the CVS so that you can always have the latest versions. (See http://devel.webwork.rochester.edu/twiki/bin/view/Webwork/WeBWorKCVSReadOnly)

Even without hooking your installation up to WeBWorK, you can see what changes have been made at http://cvs.webwork.rochester.edu/viewcvs.cgi/ and specifically at http://cvs.webwork.rochester.edu/viewcvs.cgi/webwork2/conf/global.conf.dist for changes in the global.conf directory. In particular you can see that the section I refered to above was added by Davide Cervone in revision 1.81 of global.conf.

Hope this helps.

The database Problem Library is a different matter and a bit more complicated to set up right at the moment. See John Jones comments.

<| Post or View Comments |>


userMichael Gage - Re: the use of problem library, problem set  blueArrow
7/16/2004; 4:20:47 PM (reads: 2811, responses: 0)
Error messages Error detected while loading /opt/pg/macros/PGchoicemacros.pl: PG_restricted_eval detected error at line 309 of file /opt/pg/macros/PGchoicemacros.pl 'require' trapped by operation mask at /usr/lib/perl5/5.8.0/strict.pm line 19, chunk 1. Compilation failed in require at /opt/pg/lib/WeBWorK/PG/Translator.pm line 76, chunk 1. BEGIN failed--compilation aborted at (eval 1436) line 4, chunk 1. The calling package is main

I believe that this problem is related to using perl 5.8.0 instead of 5.6.x and is related to the use of the "be_strict" pragma (analogous to use strict; in perl) which helps catch bad coding practices.

I seem to remember something about using ww_strict to get around this, but I don't have details right at the moment. Perhaps someone else using 5.8.0 can help. (Look at the file pg/lib/ww_strict.pm for ideas. I recall that a new version of Carp had an embedded 'require' which caused trouble.

In order to get something to work, you can comment out lines involving be_strict for now.

<| Post or View Comments |>


userluoy@m... - Re: the use of problem library, problem set  blueArrow
7/19/2004; 11:43:37 AM (reads: 2874, responses: 0)
Mike, Would you please give some details about "comment out lines involving be_strict"?

I would guess it is not easy to downgrade from 5.8 to 5.6.

<| Post or View Comments |>


userSam Hathaway - Re: the use of problem library, problem set  blueArrow
7/23/2004; 3:09:23 PM (reads: 2750, responses: 0)
"be_strict" is used in macro files in pg/macros. To find all occurences, use grep:

grep -r be_strict /opt/pg/macros

Then, edit each file and comment out each occurrence.

We hope to have a better solution for this problem soon.

<| Post or View Comments |>