--- loncom/xml/lonxml.pm 2006/09/29 20:36:45 1.420
+++ loncom/xml/lonxml.pm 2006/11/01 23:24:51 1.424
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.420 2006/09/29 20:36:45 albertel Exp $
+# $Id: lonxml.pm,v 1.424 2006/11/01 23:24:51 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -251,7 +251,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;
}
@@ -776,7 +776,7 @@ sub init_safespace {
$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');
+ $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 +816,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 +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'};
}
@@ -1028,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'};
}
}
@@ -1336,7 +1336,6 @@ $cleanbut
BUTTONS
$buttons.=&Apache::lonhtmlcommon::spelllink('xmledit','filecont');
- $buttons.=&Apache::lonhtmlcommon::htmlareaselectactive('filecont');
my $editfooter=(<
@@ -1743,48 +1742,6 @@ sub helpinfo {
return ($insertlist{$tagnum.'.helpfile'}, $insertlist{$tagnum.'.helpdesc'});
}
-# ----------------------------------------------------------------- whichuser
-# returns a list of $symb, $courseid, $domain, $name that is correct for
-# calls to lonnet functions for this setup.
-# - looks for form.grade_ parameters
-sub whichuser {
- my ($passedsymb)=@_;
- my ($symb,$courseid,$domain,$name,$publicuser);
- if (defined($env{'form.grade_symb'})) {
- my ($tmp_courseid)=
- &Apache::loncommon::get_env_multiple('form.grade_courseid');
- my $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid);
- if (!$allowed &&
- exists($env{'request.course.sec'}) &&
- $env{'request.course.sec'} !~ /^\s*$/) {
- $allowed=&Apache::lonnet::allowed('vgr',$tmp_courseid.
- '/'.$env{'request.course.sec'});
- }
- if ($allowed) {
- ($symb)=&Apache::loncommon::get_env_multiple('form.grade_symb');
- $courseid=$tmp_courseid;
- ($domain)=&Apache::loncommon::get_env_multiple('form.grade_domain');
- ($name)=&Apache::loncommon::get_env_multiple('form.grade_username');
- return ($symb,$courseid,$domain,$name,$publicuser);
- }
- }
- if (!$passedsymb) {
- $symb=&Apache::lonnet::symbread();
- } else {
- $symb=$passedsymb;
- }
- $courseid=$env{'request.course.id'};
- $domain=$env{'user.domain'};
- $name=$env{'user.name'};
- if ($name eq 'public' && $domain eq 'public') {
- if (!defined($env{'form.username'})) {
- $env{'form.username'}.=time.rand(10000000);
- }
- $name.=$env{'form.username'};
- }
- return ($symb,$courseid,$domain,$name,$publicuser);
-}
-
1;
__END__