[system] / trunk / pg / lib / Parser / Legacy / README Repository:
ViewVC logotype

View of /trunk/pg/lib/Parser/Legacy/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3347 - (download) (annotate)
Mon Jul 4 20:12:22 2005 UTC (14 years, 7 months ago) by dpvc
File size: 2825 byte(s)
This is an attempt at making the traditional answer checkers call the
new Parser in place of their original ones.  That is, if you follow
the instructions in the README file, then problems that use
std_num_cmp(), fun_cmp(), etc. will really be using the new Parser
instead of the original PGanswermacros.pl versions.

The old answer checkers are still available, and can be switched back
on a site-wide, course-wide, or problem-by-problem basis.  See the
README for details.

    1 These files are used to replace the original answer evaluators in
    2 PGanswermacros.pl with new ones based on the new Parser package.
    3 The NUM_CMP and FUNCTION_CMP routines are replaced by ones that use
    4 the Parser to handle the details of the answer checking, so this means
    5 all the standard routines (like std_num_cmp(), func_cmp(), etc.) now
    6 work with the new Parser.  The string answer checkers have not been
    7 modified, however (and I don't think there is much need to convert
    8 those).
    9 
   10 To install these changes, update the Parser from the CVS directory
   11 using "cvs update -d" in order to get the new Legacy direcrtory.  Then
   12 replace the PGanswermacros.pl file that is in pg/macros with the new
   13 one that is in pg/lib/Parser/Legacy (perhaps renaming the old one as
   14 PGanswermacros.pl-orig in case you want to go back to it).  Then edit
   15 the global.conf file and add [qw(Parser::Legacy)] to the $pg{macros}
   16 list (this forces the loading of a few items needed by the new
   17 PGanswermacros but that aren't loaded by default).  Finally, restart
   18 the server.  Youre WW server should now be using Parser-based answer
   19 checkers for all string and function comparisons.
   20 
   21 I believe that I have covered all the bases with these answer
   22 checkers, but this is a pretty major switch, so there undoubtedly will
   23 be problems.  I have arrange to have the original answer macros remain
   24 available, and you can go back to them on either a site-wide,
   25 course-by-course, or problem-by-problem basis.
   26 
   27 If something major goes wrong and you want to go back to using the
   28 original answer checkers, set
   29 
   30     $pg{specialPGEnvironmentVars}{useOldAnswerMacros} = 1;
   31 
   32 in global.conf.  This will disable the new answer checkers on a
   33 site-wide basis.  You can set this variable in a course.conf file to
   34 change back for just one course.
   35 
   36 If a particular problem file is causing trouble, you can set it to use
   37 the original answer checkers by putting 
   38 
   39     $useOldAnswerMacros = 1;
   40 
   41 at the top of the .pg file.  This will cause the std_num_cmp() and
   42 other answer checkers to revert to the original versions.
   43 
   44 If you have set the useOldAnswerMacros value in the global.conf or
   45 course.conf file, you can still use the new Parser-based checkers in
   46 individual problem files by putting
   47 
   48     $useOldAnswerMacros = 0;
   49 
   50 at the top of the file BEFORE the loadMacros() call that loads
   51 PGanswermacros.pl.  With this set up, you can try out the new answer
   52 checkers on an active server until you are satisfied it will work for
   53 your courses, without affecting current users while you do the tests.
   54 
   55 
   56 The new checkers should be equivalent to the original ones, at least
   57 from the problem-writer's point of view.  The internals of how they
   58 operate are not the same, however, so code that takes advantage of
   59 values within the AnswerHash structure, for example, may no longer
   60 operate correctly.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9