--- loncom/xml/lonxml.pm 2006/09/18 21:47:34 1.417 +++ loncom/xml/lonxml.pm 2006/10/04 19:48:36 1.422 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.417 2006/09/18 21:47:34 albertel Exp $ +# $Id: lonxml.pm,v 1.422 2006/10/04 19:48:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -772,8 +772,11 @@ sub init_safespace { $safehole->wrap(\&Math::Random::random_set_seed,$safeeval,'&random_set_seed'); $safehole->wrap(\&Apache::lonxml::error,$safeeval,'&LONCAPA_INTERNAL_ERROR'); $safehole->wrap(\&Apache::lonxml::debug,$safeeval,'&LONCAPA_INTERNAL_DEBUG'); + $safehole->wrap(\&Apache::lonnet::logthis,$safeeval,'&LONCAPA_INTERNAL_LOGTHIS'); + $safehole->wrap(\&Apache::inputtags::finalizeawards,$safeeval,'&LONCAPA_INTERNAL_FINALIZEAWARDS'); $safehole->wrap(\&Apache::caparesponse::get_sigrange,$safeeval,'&LONCAPA_INTERNAL_get_sigrange'); - + use Data::Dumper; + $safehole->wrap(\&Data::Dumper::Dumper,$safeeval,'&Dumper'); #need to inspect this class of ops # $safeeval->deny(":base_orig"); $safeeval->permit("require"); @@ -1014,7 +1017,7 @@ sub store_counter { } sub remember_problem_counter { - &Apache::lonnet::transfer_profile_to_env(); + &Apache::lonnet::transfer_profile_to_env(undef,undef,1); $state = $env{'form.counter'}; } @@ -1025,7 +1028,7 @@ sub store_counter { } sub get_problem_counter { if ($Apache::lonxml::counter_changed) { &store_counter() } - &Apache::lonnet::transfer_profile_to_env(); + &Apache::lonnet::transfer_profile_to_env(undef,undef,1); return $env{'form.counter'}; } } @@ -1165,7 +1168,6 @@ sub parstring { my $var_init = (@vars) ? 'my ('.join(',',@vars).') = ('.join(',',@values).');' : ''; - print STDERR $var_init."\n"; return $var_init; } @@ -1334,7 +1336,6 @@ $cleanbut BUTTONS $buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont'); - $buttons.=&Apache::lonhtmlcommon::htmlareaselectactive('filecont'); my $editfooter=(< @@ -1655,10 +1656,10 @@ sub get_param_var { } &Apache::lonxml::debug("Args are $args param is $param"); if ($case_insensitive) { - if (! ($args=~s/(my \$)(\Q$param\E)(=\")/$1.lc($2).$3/ei)) { + if (! ($args=~s/(my (?:.*))(\$\Q$param\E[,\)])/$1.lc($2)/ei)) { return undef; } - } elsif ( $args !~ /my \$\Q$param\E=\"/ ) { return undef; } + } elsif ( $args !~ /my .*\$\Q$param\E[,\)]/ ) { return undef; } my $value=&Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #' &Apache::lonxml::debug("first run is $value"); if ($value =~ /^[\$\@\%][a-zA-Z_]\w*$/) {