multiple correct answers, or answer with a constant | topic started 3/3/2004; 11:54:52 AM last post 3/4/2004; 8:13:03 AM |
|
|
|
Michael Gage - Re: multiple correct answers, or answer with a constant 3/4/2004; 8:13:03 AM (reads: 1242, responses: 0) |
Take a look at the manpages for fun_cmp at
http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/ From those examples:
* fun_cmp('x^2 + y^2 + c', vars => ['x', 'y'], params =>['c'], There is more description at http://webwork.math.rochester.edu/docs/docs/pglanguage/pod/pganswermacros.html#fun_cmp() and the code in the differential equation macros file: PGdiffeqmacros.pl may give you some ideas as well. For example the subroutine <code.level_curve_check would work for your second problem. The PGdifeqmacros.pl code needs to be cleaned up --- not many people have use it --- but there are a lot of good ideas there. You can check a student's answer against a multiple of the correct answer F(x) by fun_cmp('c*F(x)', vars=>['x'], params=>['c']);but you may need to worry a bit about matching 0 with the parameter c being set to 0. Another good source of ideas on answer evaluator construction is the macrofile PGasu.pl which John Jones put together. If you want to do particularly subtle things in evaluating answers, the code files you need to look at are AnswerHash.pm, PGanswermacros.pl, PGdiffeqmacros.pl and PGasu.pl and the problems from such subjects as differential equations or linear algebra. --Mike |