[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 5373 - (download) (as text) (annotate)
Sun Aug 19 02:01:57 2007 UTC (12 years, 3 months ago) by dpvc
File size: 1249 byte(s)
Normalized comments and headers to that they will format their POD
documentation properly.  (I know that the POD processing was supposed
to strip off the initial #, but that doesn't seem to happen, so I've
added a space throughout.)

    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->getCopy("Vector");
   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->getCopy("Vector");
   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 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9