[system] / trunk / pg / lib / Parser / Context / Variables.pm Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

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

Revision 2687 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 27 00:28:27 2004 UTC (15 years, 5 months ago) by dpvc
File length: 2470 byte(s)
Diff to previous 2666 , to selected 2658
```Added ability to have linear adaptive parameters in the function
answer checker.  It only works for real-valued functions, though.
To use a parameter, use

and then use 'a' as a variable within your answer.  The student will
not be allowed to enter the parameter, but the professor will.

Note that the correct answer will show the full professor's answer,
including the parameters, even though the student can't type it.  Is
this the right behaviour?
```

Revision 2666 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 22 00:56:32 2004 UTC (15 years, 5 months ago) by dpvc
File length: 1928 byte(s)
Diff to previous 2658
```Formulas can now be compared even if their variables are complex
numbers, or even points or vectors!  This makes it possible to ask
students for complex functions like z^2+i and so on.

You can specify limits for variables either via
Context()->variables->set(x=>{limits=>[0,1]})  (for reals) or
Context()->variables->set(z=>{limits=>[[-2,2],[0,1]]}) (for complexes).
Similarly for points and vectors (where the number of sub arrays
depends on the dimension).  You can also give the limits for a
specific formula by assigning to its ->{limits} field:

\$f = Formula("sqrt(x-10)");
\$f->{limits} = [10,12];

There are now named variable types for 'Point2D', 'Point3D',
'Vector2D' and 'Vector3D', in addition to 'Real' and 'Complex'.
You can also specify a variable type by giving an explicit instance of
a value of the given type.  E.g.

Context()->variables->add(x=>'Real',y=>0);     # two real variables
Context()->variables->add(z=>'Complex',w=>i);  # two complexes
Context()->variables->add(r=>Vector(0,0,0));   # a vector in R^3
Context()->variables->add(X=>'Vector3D');      # a vector in R^3

There still needs to be more error checking in processing
user-supplied limits, but I'm not sure how much overhead is worth it.
```

Revision 2658 - (view) (download) (as text) (annotate) - [selected]
Modified Fri Aug 20 11:17:06 2004 UTC (15 years, 5 months ago) by dpvc
File length: 1683 byte(s)
Diff to previous 2622
```Make blank patterns be ^\$ (which should never match) rather than empty
(which always matches).  this fixes a problem where if a context has
no functions, for example, the parser would attempt to create function
calls to a function named ''.
```

Revision 2622 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Aug 15 22:46:57 2004 UTC (15 years, 5 months ago) by dpvc
File length: 1640 byte(s)
Diff to previous 2579 , to selected 2658
```Created the first draft of the Parser's function answer checker.  Some
work still needs to be done, in particular, type mismatches are not
being reported, and lists are being processed only as ordered lists
with no partial credit.

This doesn't implement everything from fun_cmp.  In particular, there
is no support for parameter matching at the moment.  This will have to
be added, but I'm not quite sure how to do it when the function's
return value is not a real number (e.g., an interval).

On the other hand, this checker is more forgiving about domain errors:
if tries a point where the professor's function is not defined, it
ignores that one and looks for another (until it decides it can't find
one).  Once it has these points, it tries them on the student's
answer, and if the student's function is undefined, then the student
answer is wrong (since it is not defined somewhere that the
professor's funciton is).  This avoids the "Error evaluating student
function at ..." messages, which just confused most students anyway.
```

Revision 2579 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 9 21:38:01 2004 UTC (15 years, 5 months ago) by dpvc
File length: 1598 byte(s)
Diff to previous 2558 , to selected 2658
```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, 6 months ago) by sh002i
File length: 1599 byte(s)
Diff to selected 2658
```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 Colored Diff Long Colored Diff Unidiff Context Diff Side by Side

Sort log by:

 aubreyja at gmail dot com ViewVC Help Powered by ViewVC 1.0.9