You have an old version of either PGgraphmacros.pl or PGanswermacros.pl or
both.
The call from string_to_sub to function_from_string2 is using obsolete
option names and this is being caught by set_default_options
You can probably fix this for now by changing 'vars' = to 'ra_vars' = in
string_to_sub subroutine as shown below. sub string_to_sub { my $str_in = shift; my $var = shift; my $out = undef; if ( defined(&check_syntax) ) { #prepare the correct answer and check it's syntax my $rh_correct_ans = new AnswerHash; $rh_correct_ans-input($str_in); $rh_correct_ans = check_syntax($rh_correct_ans); warn $rh_correct_ans-{error_message} if $rh_correct_ans-{error_flag}; $rh_correct_ans-clear_error(); $rh_correct_ans = function_from_string2($rh_correct_ans, ra_vars => ['x'], store_in =>'rf_correct_ans'); my $correct_eqn_sub = $rh_correct_ans-{rf_correct_ans} warn $rh_correct_ans-{error_message} if $rh_correct_ans-{error_flag}; $out = sub{ scalar( &$correct_eqn_sub(@_) ) }; #ignore the error messages from the function.
} else { my $in =$str_in;
$in =~ s/b$varb/$XVAR/g; $in = &my_math_constants($in); my ($subRef, $PG_eval_errors,$PG_full_error_report) = PG_restricted_eval( " sub { my $XVAR = shift; my $out = $in; $out; } "); if ($PG_eval_errors) { die " ERROR while defining a function from the string:n\n$main::BR $main::BR $str_in $main::BR $main::BRn\n $PG_eval_errors" } else { $out = $subRef; }
} $out; }
You could also get the newest versions of PGanswermacros.pl and
PGgraphmacros.pl from http://webwork.math.rochester.edu/cgi-bin/cvsweb.cgi
-- they'll all be out in the new version 1.7 of webwork which Arnie should
have ready shortly.
-- you'll see that in addition to fixing the string_to_sub subroutine, the
function_from_string2 subroutine has been modified to allow vars as an
alias for ra_vars
Hope that clears things up.
-- Mike
<| Post or View Comments |> |