## Forum archive 2000-2006

### Susan Diesel - is there a bug in multivar_function_cmp?

by Arnold Pizer -
Number of replies: 0
 is there a bug in multivar_function_cmp? topic started 8/13/2001; 11:37:09 AMlast post 8/21/2001; 11:59:51 AM
 Susan Diesel - is there a bug in multivar_function_cmp?  8/13/2001; 11:37:09 AM (reads: 1880, responses: 7) When a student's previous answer is displayed next time he views a problem, I see a compiler error > Compiler warnings: > * Use of uninitialized value in join at (eval 111) line 2406. in a problem using multivar_function_cmp when the student's attempt contains variables other than those expected by WW. <| Post or View Comments |>

 Michael Gage - Re: is there a bug in multivar_function_cmp?  8/13/2001; 12:14:34 PM (reads: 2213, responses: 0) Can you tell me the file name of the problem? or send the text of the problem? One other point. Try using fun_cmp() (see manpages). This is a newer version of the multivariable_function_cmp and may have the bugs fixed. -- Mike <| Post or View Comments |>

 Michael Gage - Re: is there a bug in multivar_function_cmp?  8/13/2001; 1:06:15 PM (reads: 2227, responses: 1) So: a student tries an answer using c instead of C and getsit wrong. Later, student comes back to the problem and sees apink screen with a compiler error at the bottom.## Description ## First order ODE with xy## EndDescriptionDOCUMENT();loadMacros(PG.pl,PGbasicmacros.pl,PGchoicemacros.pl,PGanswermacros.pl,PGauxiliaryFunctions.pl,PGgraphmacros.pl, "Dartmouthmacros.pl");## Do NOT show partial correct answers$showPartialCorrectAnswers = 0;## Generate some coefficients$m = non_zero_random(-6,6,1);## Clean up stuff like -1 x$func = clean_scalar_string($m, "xy");## Ok, we are ready to begin...##TEXT(beginproblem());BEGIN_TEXT$BRSolve the following first-order differential equation: $$\displaystyle frac {dy}{dx} = func$$.\breakSimplify your answer$BBOLD completely$EBOLD. Your answer should looklike $$y = f(x)$$.\breakIf an arbitrary constant appears in your answer, you must enter it as anuppercase C.\breakFor example, a valid answer for the differential equation $$\frac{dy}{dx}= y$$would look like $$C e^x$$.$BR$$y =$$ \{ ans_rule(40) \}$PAREND_TEXT## The answer isANS(multivar_function_cmp("C*e**($m * {x**2/2})",["x","C"]));ENDDOCUMENT();Susan J. Diesel --------------------------------- Hi Susan, There are a number of possible solutions to this problem. One would be to make the answer evaluator smarter, so for example variables named C and c are equivalent. We're working on making it easier to make small changes to existing answer evaluators to handle situations such as this one. A different way to ask the question is to use fun_cmp() and have the student give a specific solution, (but the instructor gives a general solution which adapts itself to the students answer) see the params option and examples in fun_cmp. I wrote fun_cmp to handle this type of question, but it may not be the question you wanted to ask. I'll keep thinking to see if there is a cleverer way to handle this problem. One other question -- does your use of \break display properly in tth mode? and if so how do you accomplish this? (\$BR also gives a line break.) -- Mike <| Post or View Comments |>

 Zbigniew Fiedorowicz - Re: is there a bug in multivar_function_cmp?  8/14/2001; 1:04:02 PM (reads: 2475, responses: 0) Mike, I'm using PGanswermacros.pl.old in WeBWorK 1.6, which I understand are the old WeBWorK 1.5 version. This problem works fine with those old answer macros. >>> A different way to ask the question is to use fun_cmp() and have the student give a specific solution, (but the instructor gives a general solution which adapts itself to the students answer) see the params option and examples in fun_cmp. I wrote fun_cmp to handle this type of question, but it may not be the question you wanted to ask. <<< This approach doesn't work very well in the WeBWorK 1.6 version of function_cmp_up_to_constant(), as compared to the old 1.5 version of this routine. Zig Fiedorowicz <| Post or View Comments |>

 Michael Gage - Re: is there a bug in multivar_function_cmp?  8/20/2001; 6:24:43 PM (reads: 2112, responses: 0) Hi Zig, I'm not sure I understand your comment. I don't believe that any of the WeBWorK 1.5 versions will check an answer up to the addition a multiple of a function (such as e^x). Only checking functions 'defined up to a constant' was available and allowed the checking of general solutions to anti-derivatives. Even in that case I believe that one asked something like: " Find an anti-derivative of x^2 " and the answers could be x^3/3 or x^3/3 +456 but NOT x^3/3 + C Perhaps I'm not thinking of the right sort of example. -- Mike <| Post or View Comments |>

 Zbigniew Fiedorowicz - Re: is there a bug in multivar_function_cmp?  8/21/2001; 10:20:34 AM (reads: 2149, responses: 0) Hi Mike, You misunderstand. I'm not commenting on the specific format of the answers accepted by various answer evaluators. I was making a general comment about the difference in reliability between the version 1.5 and version 1.6 answer evaluators. My point was that I find the version 1.5 evaluators much more reliable. I found that the version 1.6 evaluators are unaccceptably tolerant of wrong answers. For instance, I found that (logging in as a practice user) in a great majority of indefinite integration problems in Rochester's own spring courses, I could enter nonsensical answers and have them accepted as correct (without much effort on my part). Susan's trouble with multivar_function_cmp seems to be another example of lesser reliability of a version 1.6 evaluator vis-a-vis the 1.5 version. I am concerned that the "adaption algorithm" you seem to be using in the version 1.6 evaluators has some inherent flaws as compared to the more straightforward algorithms you were using in previous versions. Zig <| Post or View Comments |>