Links to HEAD: | (view) (download) (as text) (annotate) |

Sticky Revision: |

Revision

Modified

File length: 15897 byte(s)

Diff to previous 3515

Pass the canBeInUnion call on to the Formula's root node

Revision

Modified

File length: 15848 byte(s)

Diff to previous 3487

Make formulas that produce lists get default open and close parens, and have them retained in Formula() results.

Revision

Modified

File length: 15641 byte(s)

Diff to previous 3470

Changed how Intervals implement the requireParenMatch flag for the interval and union answer checker. (Use a Context flag rather than a flag on the interval itself.) Moved the getFlag method from Formula.pm to Value.pm so it can be used by any object class. New feature where classes can add more context flags to set (and reset after the answer checker runs).

Revision

Modified

File length: 16073 byte(s)

Diff to previous 3370

Changes needed for new Set object, and moving of string, TeX and perl methods to Value.pm

Revision

Modified

File length: 15869 byte(s)

Diff to previous 3369

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

Modified

File length: 15882 byte(s)

Diff to previous 3342

Fixed various perl compiler warnings (due to extra "my", and so on).

Revision

Modified

File length: 15885 byte(s)

Diff to previous 3339

Better messages when adaptive parameters are too big.

Revision

Modified

File length: 15750 byte(s)

Diff to previous 3296

Don't use the overloaded Real class for doing adaptive parameter checks (use non-fuzzy checks, since we are checking the fuzziness by hand).

Revision

Modified

File length: 15737 byte(s)

Diff to previous 3264

Fixed a problem with auto-generated functions getting an incomplete variable list.

Revision

Modified

File length: 15804 byte(s)

Diff to previous 3261

Fix some incorrect calls when the promoting types to higher precedence object types.

Revision

Modified

File length: 15595 byte(s)

Diff to previous 3258

Avoid possible infinite loop with length and typeref calls.

Revision

Modified

File length: 15547 byte(s)

Diff to previous 3257

Better control over number of points that can be undefined, and new ability to specify required test points plus additional random ones. (Previously, if you set the test points, no random points were generated.) For example: $f = Formula("(x^2-1)/(x-1)"); $f->{test_at} = [[1]]; # test at x=1 plus random points as opposed to $f->{test_points} = [[-1],[0],[1]]; which tests only the points x = -1, x = 0 and x = 1.

Revision

Modified

File length: 15217 byte(s)

Diff to previous 3256

Modified the Formula answer checker to allow checking of points where the functions are undefined (i.e., attempt to check that the domains agree). This can be enabled by setting the checkundefinedPoints flag in the Context(), or in the formula itself. Test points where the function is undefined will be retained and the student's answer will have to be undefined at the same points. If the points are selected at random, the points where the function is undefined are kept in addition to the ones where it is defined, so the required number of test points where the function IS defined will still need to be found. The number of undefined points can be up to the number of defined points. This number can be reduced by setting the max_undefined flag. If you want to guarantee that a specific undefined point be tested, you can provide that point using the test_points field of the formula. For example: Context()->flags->set(checkUndefinedPoints=>1); $f = Formula("(x^2-1)/(x-1)"); $f->{test_points} = [[-1],[0],[1],[2]]; ANS($f->cmp); will guarantee that the singularity at x=1 is tested, so the answer x+1 will not be marked as correct. If an answer matches at all the test points where the functions are both defined, but some of the undefind points differ between the two functions, the answer checker will generate an error message indicating that the domains of the functions don't agree. (This is ONLY generated with the functions match except for that.) This can be controlled by setting the showDomainErrors flag in the formula's cmp() call: ANS($f->cmp(showDomainErrors=>0)); The default is to show these errors.

Revision

Modified

File length: 14562 byte(s)

Diff to previous 3218

Fixed an accidental hard-coded operation from always being "add" to being the correct operation when promoting the operations to an object of higher precedence. (But since formulas are normally the highest precedence, this will never have occurred.)

Revision

Modified

File length: 14513 byte(s)

Diff to previous 3216

Fixed a bug with adaptive parameters where the relative tolerance was not being properly computed. This allowed large constants to be treated as correct when they shouldn't be.

Revision

Modified

File length: 13033 byte(s)

Diff to previous 3192

Use correct form of "x" with lists (rather than hack using split()).

Revision

Modified

File length: 13063 byte(s)

Diff to previous 3177

Update the overloaded operators so that they can be overridden by subclasses of the predefined object classes. This involves calling the objects method rather than using a hard reference to the routine in the parent class. Also, change the name of the string comparison routine to compare_string to avoid conflicts with cmp that is used to produce the answer checker for the class. Finally, in Value.pm, promotePrecedence no longer has to do fancy footwork to get "special" precedence to work (this was a hack to get around the misfeature of the overloaded operators -- now that that is being handled correctly, there is no need for it).

Revision

Modified

File length: 12853 byte(s)

Diff to previous 3174

Missed one situation when making the previous update. Fixed it.

Revision

Modified

File length: 12853 byte(s)

Diff to previous 2800

Fixed it so that direct calls to the add, sub, mult, etc functions would work as expected (even though there is no need to call them directly).

Revision

Modified

File length: 12853 byte(s)

Diff to previous 2688

Added isZero and isOne checks for Parser::Value objects (i.e., for constants within formulas). These now correctly handle vector and matrices, in particular. The isOne and isZero checks are used in the reduce() method to simplify formulas.

Revision

Modified

File length: 12780 byte(s)

Diff to previous 2687

Added in functMaxConstantOfIntegration support in the adaptive parameter answer checking. Also added a flag to the formula answer checker that allows checking a formula up to a constant (for integration problems). This really just adds a new parameter to the context and adds that to the formula, so there is nothing deep about this. ANS(Formula("2x")->cmp(upToConstant=>1)); Finally, don't look for adaptive parameters if they aren't actually used in the professor's formula (even if they are defined).

Revision

Modified

File length: 12344 byte(s)

Diff to previous 2678

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 Context()->variables->add(a=>'Parameter'); 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

Modified

File length: 10631 byte(s)

Diff to previous 2671

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

Modified

File length: 10559 byte(s)

Diff to previous 2669

Fixed some inconsistencies between handing of matrices within the parser and Value packages. Added a predefined Matrix context.

Revision

Modified

File length: 10521 byte(s)

Diff to previous 2668

Made the granularity of the test-point intervals be a parameter that can be set on a global or variable-by-variable basis, so this is now controlable from the .pg file. For example: Context("Numeric")->variables->are( k=>{limits=>[1,10], resolution=>1}, x=>{limits=>[-2,2], granularity=>1000}, ); will make k be a variable that will only take on integer values between 1 and 10, and x a variable that will take on one of 1000 different values evenly spaced between -2 and 2 (so resolution is 4/1000 in this case). These parameters can also be set for an individual formula: $f = Formula("k^2-1"); $f->{resolution} = 1; $f->{limits} = [0,10];

Revision

Modified

File length: 10149 byte(s)

Diff to previous 2666

Fixed TeX output of Matrices to use \array rather than \matrix for matrices with formulas as entries (this had already been fixed for constant matrices). Made intervals produce formulas when of of the endpoints is a formula. Removed unneeded comment.

Revision

Modified

File length: 10204 byte(s)

Diff to previous 2629

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

Modified

File length: 8353 byte(s)

Diff to previous 2625

Fixed a number of minor problems with creating perl functions from formulas (this is done automatically as part of the function answer checker, so is showing up now that I have that checker in place). Also improved error messages in the function answer checker, and fixed a bug when students enter a constant list or union when the answer checker expects formulas.

Revision

Modified

File length: 8351 byte(s)

Diff to previous 2624

Added string comparison to all Value object classes (to compare the string value of an object to another string). Overloaded perl '.' operator to do dot product when the operands are formulas returning vectors. (Part of the auto-generation of formulas). A few improvements to real and complex class output results. Made Union class slightly more robust and removed need for makeUnion method other than in the Union itself.

Revision

Modified

File length: 8052 byte(s)

Diff to previous 2622

Added support for unorderd list or formulas with partial credit. Fixed type mismatch reporting in formula answer checker. Fixed an error with Unions producing incorrect perl versions under some circumstances.

Revision

Modified

File length: 7897 byte(s)

Diff to previous 2621

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

Modified

File length: 3677 byte(s)

Diff to previous 2606

Improved error messages, particularly when the student enters a formula in an answer that should be constant, and also for incorrect answers in lists of answers. There are a few other miscellaneous output improvements as well.

Revision

Modified

File length: 3508 byte(s)

Diff to previous 2558

Can now specify that the objects stringify themselfs in their TeX forms rather than their answer-string forms. This makes it easier to use the objects in the text of a problem (without having to call ->TeX explicitly each reference). Use Context()->texStrings to start outputting TeX strings, and Context()->normalStrings to switch back.

Revision

Added

File length: 3573 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.

aubreyja at gmail dot com | ViewVC Help |

Powered by ViewVC 1.0.9 |