--- loncom/xml/lonxml.pm 2010/09/29 16:09:20 1.518
+++ loncom/xml/lonxml.pm 2011/11/11 02:55:37 1.522
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.518 2010/09/29 16:09:20 raeburn Exp $
+# $Id: lonxml.pm,v 1.522 2011/11/11 02:55:37 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -112,6 +112,7 @@ use Apache::lonmaxima();
use Apache::lonr();
use Apache::lonlocal;
use Apache::lonhtmlcommon();
+use Apache::functionplotresponse();
#==================================== Main subroutine: xmlparse
@@ -787,6 +788,11 @@ sub init_safespace {
$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');
+ $safehole->wrap(\&Apache::functionplotresponse::fpr_val,$safeeval,'&fpr_val');
+ $safehole->wrap(\&Apache::functionplotresponse::fpr_f,$safeeval,'&fpr_f');
+ $safehole->wrap(\&Apache::functionplotresponse::fpr_dfdx,$safeeval,'&fpr_dfdx');
+ $safehole->wrap(\&Apache::functionplotresponse::fpr_d2fdx2,$safeeval,'&fpr_d2fdx2');
+
# use Data::Dumper;
# $safehole->wrap(\&Data::Dumper::Dumper,$safeeval,'&LONCAPA_INTERNAL_Dumper');
#need to inspect this class of ops
@@ -838,7 +844,8 @@ sub initialize_rndseed {
sub default_homework_load {
my ($safeeval)=@_;
&Apache::lonxml::debug('Loading default_homework');
- my $default=&Apache::lonnet::getfile('/home/httpd/html/res/adm/includes/default_homework.lcpm');
+ my $default=&Apache::lonnet::getfile($Apache::lonnet::perlvar{'lonIncludes'}.
+ '/default_homework.lcpm');
if ($default eq -1) {
&Apache::lonxml::error("Unable to find default_homework.lcpm");
} else {
@@ -1008,7 +1015,7 @@ the current 'bubble line number' is stor
The value of it is stored in $Apache:lonxml::counter when live and
stored back to env after done.
-=item &increment_counter($increment);
+=item &increment_counter($increment, $part_response);
Increments the internal counter environment variable a specified amount
@@ -1841,8 +1848,9 @@ sub debug {
}
sub show_error_warn_msg {
- if ($env{'request.filename'} eq '/home/httpd/html/res/lib/templates/simpleproblem.problem' &&
- &Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ if (($env{'request.filename'} eq
+ $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/lib/templates/simpleproblem.problem') &&
+ (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
return 1;
}
return (($Apache::lonxml::debug eq 1) ||
@@ -2039,8 +2047,8 @@ sub register_insert_xml {
my $key;
if ($token->[1] eq 'tag') {
$tag = $token->[2]{'name'};
- $insertlist{"$tagnum.tag"} = $tag;
- $insertlist{"$tag.num"} = $tagnum;
+ $insertlist{$tagnum.'.tag'} = $tag;
+ $insertlist{$tag.'.num'} = $tagnum;
push(@alltags,$tag);
} elsif ($in_help && $token->[1] eq 'file') {
$key = $tag.'.helpfile';
@@ -2073,12 +2081,12 @@ sub register_insert_xml {
# parse the allows and ignore tags set to no
foreach my $tag (@alltags) {
- next if (!exists($insertlist{"$tag.allow"}));
- my $allow = $insertlist{"$tag.allow"};
+ next if (!exists($insertlist{$tag.'.allow'}));
+ my $allow = $insertlist{$tag.'.allow'};
foreach my $element (split(',',$allow)) {
$element =~ s/(^\s*|\s*$ )//gx;
- if (!exists($insertlist{"$element.show"})
- || $insertlist{"$element.show"} ne 'no') {
+ if (!exists($insertlist{$element.'.show'})
+ || $insertlist{$element.'.show'} ne 'no') {
push(@{ $insertlist{$tag.'.which'} },$element);
}
}