[system] / trunk / pg / lib / Parser / Context.pm Repository:
ViewVC logotype

Log of /trunk/pg/lib/Parser/Context.pm

Parent Directory Parent Directory

Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 4928 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Apr 17 00:36:16 2007 UTC (12 years, 7 months ago) by dpvc
File length: 5521 byte(s)
Diff to previous 3714
Modified the way the Parser-based versions of the traditional answer
checkers get copies of their contexts.  They now use a new method
getCopy to obtain the copy either from the problem's context table or
the default table (rather than only from the default).  That way the
instructor can use parserCustomization.pl to customize the contexts
used by the answer checkers.

Revision 3714 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Oct 16 02:44:34 2005 UTC (14 years, 1 month ago) by dpvc
File length: 5136 byte(s)
Diff to previous 3569
Modified context data objects to provide a copy method so that the
various types of data can copy themselves (and can provide a more
comprehensive copy if necessary).

Revision 3569 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 25 03:40:44 2005 UTC (14 years, 3 months ago) by dpvc
File length: 5237 byte(s)
Diff to previous 3370
Fixed problem with Context's not properly initializing themselves with
the WW environment parameters (like zeroLevelTol and useBaseTenLog).
The copy method and the method that did an initialized copy used to be
separate routines, but that turned out to be unnecessary, so they have
now been merged (copy always tries to initialize the WW values when it
can, and when the copied context doesn't already have them).

The reason this is complicated is that a number contexts are set up
before the global.conf data is available, so these can't be
initialized with the WW values.  Also, these default contexts are
stored in the persistant processes, and we don't want to leave
possibly course-specific values lying around in them, so whenever a
context is selected, it is copied from the standard version and the
WW parameters are inserted into it.  The problem author can only
modify the copy, not the original, so this is OK with mod_perl.

The context's copy method now always tries to initialize (we used to
have to call initCoopy to get a copy that has the WW parameters
inserted).  That turned out to cause trouble with code that handled
contexts without the usual Context() command.

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (14 years, 4 months ago) by dpvc
File length: 5249 byte(s)
Diff to previous 3193
A first pass at making parser error messages localizable.  The
Context()->{error}{msg} hash can be used to specify translations of
the standard messages.  For example,

    Context()->{error}{msg}{'Division by zero'} = "Don't divide by zero, dude!";
    Context()->{error}{msg}{'Function '%s' has too many inputs'} =
        "You passed too many arguments to '%s'";

(I didn't translate into another language, here, but you could do
that, too.)

The msg hash could also be used within answer checkers to make certain
answer messages more appropriate for the given type of expected answer.

Revision 3193 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 13:33:59 2005 UTC (14 years, 8 months ago) by dpvc
File length: 5246 byte(s)
Diff to previous 2907
Fixed a typo.

Revision 2907 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Oct 12 20:44:20 2004 UTC (15 years, 1 month ago) by dpvc
File length: 5246 byte(s)
Diff to previous 2796
In StandardPrecedence mode, make the precedence of function apply
match that in use by that AlgParser.

Revision 2796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 19 01:15:03 2004 UTC (15 years, 2 months ago) by dpvc
File length: 5244 byte(s)
Diff to previous 2678
Added flags that control the reductions performed by
Formula()->reduce.  Each reduction operation can be individually
enabled or disabled in the context, and in the reduce() call itself.

More complex reductions need to be developed.

Revision 2678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 23 23:55:37 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4872 byte(s)
Diff to previous 2665
Modified the parser so that the classes for the various object
constructors are stored in the context table rather than hard-coded
into the parser.  That way, you can override the default classes with
your own.  This gives you even more complete control to modify the
parser.  (You had been able to replace the definitions of operators,
functions and list-like objects, but could not override the behaviour
of numbers, strings, variables, and so on.  Now you can.)

This effects most of the files, but only by changing the name of the
calls that create the various objects.

There are also a couple of other minor fixes.

Revision 2665 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 22 00:41:44 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4782 byte(s)
Diff to previous 2664
Made the default context be Numeric context rather than Full context.
Since there is only one variable in this context, it will speed up
function answer checking.  It will also encourage you to choose the
correct context explicitly.

Also changed Complex context to have z as the only variable.  If you
want x and y as reals, you need to add them in by hand.  Again, this
is for efficiency in answer checking.

Revision 2664 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 21 22:02:14 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4779 byte(s)
Diff to previous 2647
Added a file to perform WeBWorK-specific modifications to the
Parser/Value packages.  (I've tried to make these independent of
WeBWorK, so you can use them in other perl code if you want to.)

The parameters for fuzzy reals and some of the other parameters now
are taken from the pg->{ansEvalDefaults} values (as defined in
global.conf or course.conf).  More still needs to be done with this,

Revision 2647 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 19 12:18:56 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4769 byte(s)
Diff to previous 2620
Context() now accepts a reference to an actual Context object rather
than a name of a predefined context, and will switch to that.

Revision 2620 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 15 12:02:05 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4691 byte(s)
Diff to previous 2619
Had to put back the global context variable after all.  :-(
It gets reset in Parser.pl, so it should be OK even with mod_perl.

Revision 2619 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 15 00:45:46 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4500 byte(s)
Diff to previous 2579
Modified Context() function so that it no longer uses a global package
variable for storing the user's context table.

Revision 2579 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 9 21:38:01 2004 UTC (15 years, 3 months ago) by dpvc
File length: 4502 byte(s)
Diff to previous 2558
Significant update to new parser.

New features include:

  Better control over format of vector output (you can now
    specify ijk-format rather than <...> format)

  "Fuzzy" reals, where the relations like == return true when the
    two values are "close enough".  (This is controlable using
    parameters similar to those used in NUM_CMP).

  The fuzzy reals are now used in vectors/points/matrices/complexes/intervals
    and so on so that their relations will also be fuzzy.  E.g.,
    (1E-13,2) == (0,3) will be true, and norm(Vector(0,1E-13)) will
    equal 0.

  The two main portions of the parser (the Parser and Value packages)
    now share a common context object for configuration purposes.

Revision 2558 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Jul 28 20:32:33 2004 UTC (15 years, 4 months ago) by sh002i
File length: 5299 byte(s)
merged changes from rel-2-1-a1 -- stop using that branch.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9