## Forum archive 2000-2006

### Michael Hamm - multiple correct answers, or answer with a constant ### Michael Hamm - multiple correct answers, or answer with a constant

by Arnold Pizer -
Number of replies: 0 multiple correct answers, or answer with a constant topic started 3/3/2004; 11:54:52 AMlast post 3/4/2004; 8:13:03 AM Michael Hamm - multiple correct answers, or answer with a constant 3/3/2004; 11:54:52 AM (reads: 1035, responses: 3) Hi, A couple of questions with which I hope someone can help me. First, consider the question "express this real-life scenario as a diff.eq." (without initial condition). Thw answer has a constant in it, which is not mentioned in the question, so students can choose any they like. Can I allow for that? How? And if not, then what shall I do? Second, consider the question "prove that this diff.eq. is separable by writing f(y) y' = g(x) ". I'll leave a blank for each function (f,g), but, of course, any answer pair which is a constant multiple of the 'correct' answer is also correct. Any ideas on how ot do this? <| Post or View Comments |> Carl F. Letsche - Re: multiple correct answers, or answer with a constant 3/3/2004; 3:22:44 PM (reads: 1222, responses: 0) The second one is easier to answer.  You need to set the two student answers f(x) and g(y) as a ratio to compare with your ratio of f and g. Then use the multivariable answer scheme with the usual precautions against checking values where the denominator's 0. As far as the first one goes, are they using an actual constant, or some letter k? in the case of a letter k, you can set a ratio of their answer against your version of the answer with k=1, and check it against the function k. If they're using an actual constant, you can check the ratio against a constant function up to a constant (as you would check indefinite integrals), but also check against it being 0 (the easy answer). Both of these require grabbing and manipulating the student's submitted answers and checking the results. I'm not familiar with how that's done in the current versions of WeBWorK, but I know it can be done. It's been discussed in this list before, but may have changed - it depends what version you're running. Others can help with those details.  Carl<| Post or View Comments |> Michael Hamm - Re: multiple correct answers, or answer with a constant 3/4/2004; 1:43:04 AM (reads: 1215, responses: 0) ... and I do hope someone will. The archives of this discussion group on the Web at Rochester are meager, and I don't see this stuff there. But now that I have your ideas (thanks), I can look through the Problem Library.... <| Post or View Comments |> 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'], limits => [[-4,4],[-2,6]], numPoints => 10 ) will match 'x^2 +y^2 + 25'.* fun_cmp( 'cos(x) + a*e^(-x) + b*e^(2x)', params =>['a', 'b']) will accept a linear family of solutions, e.g. solution set to a linear ODE* fun_cmp( 'x^2 +sin(c*x)' , params =>['c']) will NOT work. The expressions have to be linear in the parameters (but of course they can be non-linear in the variables such as x). 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 ['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 <| Post or View Comments |>