[system] / trunk / pg / macros / parserCustomization.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/parserCustomization.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4856 - (download) (as text) (annotate)
Wed Mar 7 18:34:55 2007 UTC (12 years, 9 months ago) by gage
File size: 1278 byte(s)
Added documentation

    1 sub _parserCustomization_init {}
    2 
    3 =head1 parserCustomization
    4 
    5  #
    6  #  Copy this file to your course templates directory and put any
    7  #  customization for the Parser that you want for your course
    8  #  here.  For example, you can make vectors display using
    9  #  ijk notation (and force students to use it for entering
   10  #  vectors) by uncommenting:
   11  #
   12  #    $context{Vector} = $Parser::Context::Default::context{Vector}->copy;
   13  #    $context{Vector}->flags->set(ijk=>1);
   14  #    $context{Vector}->parens->remove('<');
   15  #
   16  #  To allow vectors to be entered with parens (and displayed with
   17  #  parens) rather than angle-brakets, uncomment
   18  #
   19  #    $context{Vector} = $Parser::Context::Default::context{Vector}->copy;
   20  #    $context{Vector}->{cmpDefaults}{Vector} = {promotePoints => 1};
   21  #    $context{Vector}->lists->set(Vector=>{open=>'(', close=>')'});
   22  #
   23  #  (This actually just turns points into vectors in the answer checker
   24  #  for vectors, and displays vectors using parens rather than angle
   25  #  brakets.  The student is really still entering what the Parser
   26  #  thinks is a point, but since points get promoted automatically
   27  #  in the Value package, that should work.  But if a problem checks
   28  #  if a student's value is actually a Vector, that will not be true.)
   29  #
   30 
   31 =cut
   32 
   33 
   34 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9