Forum archive 2000-2006

Davide P. Cervone - Using the Parser with WeBWorK version 1.x

Davide P. Cervone - Using the Parser with WeBWorK version 1.x

by Arnold Pizer -
Number of replies: 0
inactiveTopicUsing the Parser with WeBWorK version 1.x topic started 8/22/2005; 3:27:47 PM
last post 8/22/2005; 3:27:47 PM
userDavide P. Cervone - Using the Parser with WeBWorK version 1.x  blueArrow
8/22/2005; 3:27:47 PM (reads: 259, responses: 0)
For those of you running WW1.x but interested in using problems that rely on the new Parser package, it is possible to incorporate the Parser into WW1.x. Here is how to do it:

First, you will need to get the complete Parser and Value trees from pg/lib directory of WW2. That is, you will need pg/lib/Parser.pm, pg/lib/Parser and all its subdirectories, and also pg/lib/Value.pm, pg/lib/Value and all its subdirectories, plus pg/macros/Parser.pl and pg/macros/Value.pl. You also will want anything in pg/macros that starts with "parser" or "context" or "answer". Finally, you will need to pg/macros/PGauxiliaryFuncxtion.pl and pg/macros/PGcommonFunctions.pl files as well. These can all be obtained from the CVS repository, and you can check out just these directories and files without having to get the complete pg distribution, if you want.

You should put all the files and directories listed above into the webwork/system/courseScripts directory. Then you need to modify webwork/system/courseScripts/PG_mdouls_list.pl to cause it to load the Parser files. You do that by adding "Parser" to the end of the PGtranslator -> evaluate_modules list (after "Regression"), and add "Value" to the PGtranslator -> load_extra_packages list (after "AnswerEvaluator"). That should do it.

Note that this will cause the Parser package to be loaded for every problem, even those that don't use the Parser. That could have an effect on your server's response time. (WW2 does not suffer from this because it uses the mod_perl Apache module tha tuses persistent environments in the server processes, so the Parser only needs to be loaded once and every later problem handled by that process will get to use that already loaded copy.)

Let me know if you try this and experience problems.

Davide

<| Post or View Comments |>