--- loncom/xml/lonxml.pm 2006/10/03 20:37:07 1.421
+++ loncom/xml/lonxml.pm 2006/12/24 22:13:20 1.434
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.421 2006/10/03 20:37:07 albertel Exp $
+# $Id: lonxml.pm,v 1.434 2006/12/24 22:13:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -88,6 +88,7 @@ use Apache::loncommon();
use Apache::lonfeedback();
use Apache::lonmsg();
use Apache::loncacc();
+use Apache::lonmaxima();
use Apache::lonlocal;
#================================================== Main subroutine: xmlparse
@@ -251,7 +252,7 @@ sub printtokenheader {
my ($target,$token,$tsymb,$tcrsid,$tudom,$tuname)=@_;
unless ($token) { return ''; }
- my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
+ my ($symb,$courseid,$domain,$name) = &Apache::lonnet::whichuser();
unless ($tsymb) {
$tsymb=$symb;
}
@@ -342,6 +343,11 @@ sub xmlparse {
my $finaloutput = &inner_xmlparse($target,\@stack,\@parstack,\@pars,
$safeeval,\%style_for_target,1);
+ if (@stack) {
+ &warning("At end of file some tags were still left unclosed, ".
+ '<'.join('>, <',reverse(@stack)).
+ '>');
+ }
if ($env{'request.uri'}) {
&writeallows($env{'request.uri'});
}
@@ -669,6 +675,14 @@ sub init_safespace {
'&chem_standard_order');
$safehole->wrap(\&Apache::response::check_status,$safeeval,'&check_status');
+ $safehole->wrap(\&Apache::lonmaxima::maxima_eval,$safeeval,'&maxima_eval');
+ $safehole->wrap(\&Apache::lonmaxima::maxima_check,$safeeval,'&maxima_check');
+ $safehole->wrap(\&Apache::lonmaxima::maxima_cas_formula_fix,$safeeval,
+ '&maxima_cas_formula_fix');
+
+ $safehole->wrap(\&Apache::caparesponse::capa_formula_fix,$safeeval,
+ '&capa_formula_fix');
+
$safehole->wrap(\&Math::Cephes::asin,$safeeval,'&asin');
$safehole->wrap(\&Math::Cephes::acos,$safeeval,'&acos');
$safehole->wrap(\&Math::Cephes::atan,$safeeval,'&atan');
@@ -775,8 +789,8 @@ 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');
- use Data::Dumper;
- $safehole->wrap(\&Data::Dumper::Dumper,$safeeval,'&Dumper');
+# use Data::Dumper;
+# $safehole->wrap(\&Data::Dumper::Dumper,$safeeval,'&LONCAPA_INTERNAL_Dumper');
#need to inspect this class of ops
# $safeeval->deny(":base_orig");
$safeeval->permit("require");
@@ -816,7 +830,7 @@ sub delete_package_recurse {
sub initialize_rndseed {
my ($safeeval)=@_;
my $rndseed;
- my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
+ my ($symb,$courseid,$domain,$name) = &Apache::lonnet::whichuser();
$rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name);
my $safeinit = '$external::randomseed="'.$rndseed.'";';
&Apache::lonxml::debug("Setting rndseed to $rndseed");
@@ -1017,7 +1031,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'};
}
@@ -1028,7 +1042,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'};
}
}
@@ -1327,11 +1341,15 @@ FULLPAGE
my $cleanbut = '';
my $titledisplay=&display_title();
- my %lt=&Apache::lonlocal::texthash('st' => 'Save this',
- 'vi' => 'View',
+ my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit',
+ 'vi' => 'Save and View',
+ 'dv' => 'Discard Edits and View',
+ 'un' => 'undo',
'ed' => 'Edit');
my $buttons=(<