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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6058 - (view) (download) (as text)

1 : sh002i 5556 ################################################################################
2 :     # WeBWorK Online Homework Delivery System
3 :     # Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4 : gage 6058 # $CVSHeader$
5 : sh002i 5556 #
6 :     # This program is free software; you can redistribute it and/or modify it under
7 :     # the terms of either: (a) the GNU General Public License as published by the
8 :     # Free Software Foundation; either version 2, or (at your option) any later
9 :     # version, or (b) the "Artistic License" which comes with this package.
10 :     #
11 :     # This program is distributed in the hope that it will be useful, but WITHOUT
12 :     # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 :     # FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the
14 :     # Artistic License for more details.
15 :     ################################################################################
16 :    
17 : sh002i 5555 =head1 NAME
18 : dpvc 3588
19 : sh002i 5555 parserCustomization.pl - Placeholder for site/course-local customization file.
20 : dpvc 3588
21 : sh002i 5555 =head1 DESCRIPTION
22 : dpvc 3588
23 : sh002i 5555 Copy this file to your course templates directory and put any
24 :     customization for the Parser that you want for your course
25 :     here. For example, you can make vectors display using
26 :     ijk notation (and force students to use it for entering
27 :     vectors) by uncommenting:
28 :    
29 :     $context{Vector} = Parser::Context->getCopy("Vector");
30 :     $context{Vector}->flags->set(ijk=>1);
31 :     $context{Vector}->parens->remove('<');
32 :    
33 :     To allow vectors to be entered with parens (and displayed with
34 :     parens) rather than angle-brakets, uncomment
35 :    
36 :     $context{Vector} = Parser::Context->getCopy("Vector");
37 :     $context{Vector}->{cmpDefaults}{Vector} = {promotePoints => 1};
38 :     $context{Vector}->lists->set(Vector=>{open=>'(', close=>')'});
39 :    
40 :     (This actually just turns points into vectors in the answer checker
41 :     for vectors, and displays vectors using parens rather than angle
42 :     brakets. The student is really still entering what the Parser
43 :     thinks is a point, but since points get promoted automatically
44 :     in the Value package, that should work. But if a problem checks
45 :     if a student's value is actually a Vector, that will not be true.)
46 :    
47 : gage 4856 =cut
48 :    
49 : sh002i 5555 sub _parserCustomization_init {}
50 :    
51 : dpvc 3588 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9