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

Log of /trunk/pg/lib/Parser/Legacy/NumberWithUnits.pm

Parent Directory Parent Directory


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

Revision 5014 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Jun 22 00:26:47 2007 UTC (12 years, 8 months ago) by dpvc
File length: 7003 byte(s)
Diff to previous 5001
Fixed context issues and a typo (must have been interrupted when
editing this file earlier).  Also modified the units pattern to allow
trailing spaces.

Revision 5001 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 12 04:05:56 2007 UTC (12 years, 8 months ago) by dpvc
File length: 6794 byte(s)
Diff to previous 4994
More fixes for creating items in the corret context.  Also added a
method for looking up the package associated with a particular Parser
class (for consistency with the Value->Package call).

Revision 4994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 10 01:17:29 2007 UTC (12 years, 8 months ago) by dpvc
File length: 6819 byte(s)
Diff to previous 4672
Update to handle the fact that the Value package now includes the
context with all MathObjects.  (This may still need some work.)

Revision 4672 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 04:20:40 2006 UTC (13 years, 2 months ago) by dpvc
File length: 6632 byte(s)
Diff to previous 4669
Abstracted the NumberWithUnits to a more general ObjectWithUnits and
moved the FormulaWithUnits to this file as well, since most of the
code is common.  Although, strictly speaking, FormulaWithUnits is not
legacy code, since the general object-with-units is here, it will be
easier to maintain FormulaWithUnits here as well.  When the Parser
gets a real units class, all of this can be removed.

Also fixed the unit lookup code to use the actual names from the Units
library, so we can now be more accurate about determining the extent
of the units, and can handle things like '5 kg m / s' now.  In the
case of ambiguous formulas with units, e.g., '5m kg' where m is a
variable, use '5*m kg' or '(5m) kg'.

Revision 4669 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Nov 27 00:00:46 2006 UTC (13 years, 2 months ago) by dpvc
File length: 4435 byte(s)
Diff to previous 4667
The Units.pm library only accepts one division within the units, and
the Parser wasn't taking that into account, so students could enter
m/s/s and still get credit even if the units were m/s.  This have been
fixed.

Revision 4667 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Nov 26 21:58:43 2006 UTC (13 years, 2 months ago) by dpvc
File length: 4224 byte(s)
Diff to previous 4528
Fixed a problem where the TeX version included two copies of the units
(one in TeX mode and one from the string() output).

Revision 4528 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 27 17:15:18 2006 UTC (13 years, 4 months ago) by dpvc
File length: 4113 byte(s)
Diff to previous 4511
Fixed problem where a zero with units would me marked as "not looking
like anumber with units".

Revision 4511 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 20 23:38:38 2006 UTC (13 years, 5 months ago) by dpvc
File length: 4079 byte(s)
Diff to previous 4510
Make a more sophisticated unit check so that it will handle things
like "3ft / s" (that don't have a space before the units).

Really need to make a units class for the Parser.

Revision 4510 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Sep 20 21:50:56 2006 UTC (13 years, 5 months ago) by dpvc
File length: 3528 byte(s)
Diff to previous 3370
Fixed unit checking so that units can include spaces (like 4 ft /
min).  Also fixed a problem where units were not being reported as
part of the student's entered answer.

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (14 years, 7 months ago) by dpvc
File length: 3395 byte(s)
Diff to previous 3347
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 3347 - (view) (download) (as text) (annotate) - [select for diffs]
Added Mon Jul 4 20:12:22 2005 UTC (14 years, 7 months ago) by dpvc
File length: 3393 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.

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