Forum archive 2000-2006

Mike Gallis - Problems with custom Answer macros?

Mike Gallis - Problems with custom Answer macros?

by Arnold Pizer -
Number of replies: 0
inactiveTopicProblems with custom Answer macros? topic started 8/21/2000; 9:37:41 PM
last post 8/21/2000; 9:37:41 PM
userMike Gallis - Problems with custom Answer macros?  blueArrow
8/21/2000; 9:37:41 PM (reads: 1069, responses: 0)
I've been using the custom answer evaluating function almost verbatum from the example in the docs. (Specifically, the answer contains case insensitive substring from the mozart examples). This seems not to work with the spring release version of Webworks.

Obvious mistake of not having the DOCUMENT(); call first has been fized, but even with a direct cut and paste of the sample evaluating function, I get:

ERROR caught by PGtranslator while processing problem file:mset0/mprob2.pg
*
syntax error at (eval 38) line 37, at EOF

and

29		$testAnswer = sub {
30 my $in = @_; # get the answer from the student
31 my $correctQ; # variable will be set to 1 if the answer is
32 # correct.
33 my $PGanswerMessage ="" # message to be printed on screen
34 if ($in =~ /Mozart/) {
35 # if the string "Mozart" appears in the answer
36 $correctQ =1;
37 }
38 else {
39 $correctQ = 0;
40 }
41 ($correctQ, "Wolfgang Amadeus Mozart", $in, $PGanswerMessage);
42 };
43 ANS($testAnswer);

Any clues would be greatly appreciated!

-Mike Gallis

<| Post or View Comments |>