[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm essayresponse.pm inputtags.pm lonhomework.pm outputtags.pm structuretags.pm /interface slotrequest.pm /xml lonxml.pm scripttag.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 17 Oct 2006 15:11:38 -0000


This is a MIME encoded message

--albertel1161097898
Content-Type: text/plain

albertel		Tue Oct 17 11:11:38 2006 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm essayresponse.pm inputtags.pm 
                    	lonhomework.pm outputtags.pm structuretags.pm 
    /loncom/interface	slotrequest.pm 
    /loncom/xml	lonxml.pm scripttag.pm 
  Log:
  - complte the move of whichuser() from lonnxml -> lonnet
  
  
--albertel1161097898
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20061017111138.txt"

Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.184 loncom/homework/bridgetask.pm:1.185
--- loncom/homework/bridgetask.pm:1.184	Wed Oct 11 17:06:49 2006
+++ loncom/homework/bridgetask.pm	Tue Oct 17 11:11:11 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.184 2006/10/11 21:06:49 albertel Exp $
+# $Id: bridgetask.pm,v 1.185 2006/10/17 15:11:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -105,7 +105,7 @@
 sub check_in_sequence {
     my ($user,$domain,$slot_name) = @_;
     my $navmap = Apache::lonnavmaps::navmap->new();
-    my ($symb) = &Apache::lonxml::whichuser();
+    my ($symb) = &Apache::lonnet::whichuser();
     my ($map)  = &Apache::lonnet::decode_symb($symb);
     my @resources = 
 	$navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0);
@@ -225,7 +225,7 @@
 }
 
 sub add_grading_button {
-    my (undef,$cid)=&Apache::lonxml::whichuser();
+    my (undef,$cid)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
     my %sections = &Apache::loncommon::get_sections($cdom,$cnum);
@@ -388,7 +388,7 @@
 }
 
 sub submission_time_stamp {
-    my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
     my $submissiontime;
     my $version=$Apache::lonhomework::history{'resource.0.version'};
     for (my $v=$Apache::lonhomework::history{'version'};$v>0;$v--) {
@@ -426,7 +426,7 @@
 sub file_list {
     my ($files,$uname,$udom) = @_;
     if (!defined($uname) || !defined($udom)) {
-	(undef,undef,$udom,$uname) = &Apache::lonxml::whichuser();
+	(undef,undef,$udom,$uname) = &Apache::lonnet::whichuser();
     }
     my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/';
 
@@ -487,7 +487,7 @@
     my ($version) = @_;
     my $title=&Apache::lonnet::gettitle();
     my @files=split(',',$Apache::lonhomework::history{'resource.'.$version.'.0.bridgetask.portfiles'});
-    my (undef,undef,$domain,$user)= &Apache::lonxml::whichuser();
+    my (undef,undef,$domain,$user)= &Apache::lonnet::whichuser();
     my $files = '<ul>';
     my $msg;
     foreach my $file (@files) {
@@ -831,7 +831,7 @@
     if (defined($env{'form.regradeaspecificsubmission'}) &&
 	defined($env{'form.gradinguser'})               &&
 	defined($env{'form.gradingdomain'})               ) {
-	my ($symb,$cid)=&Apache::lonxml::whichuser();
+	my ($symb,$cid)=&Apache::lonnet::whichuser();
 	my $cnum  = $env{'course.'.$cid.'.num'};
 	my $cdom  = $env{'course.'.$cid.'.domain'};
 	my $uname = $env{'form.gradinguser'};
@@ -1170,7 +1170,7 @@
 		$Apache::lonhomework::results{"resource.$version.0.awarded"}='0';
 		&remove_from_queue($env{'form.queue'}); 
 
-		my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+		my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
 		
 		if ($env{'form.regrade'} ne 'yes') {
 		    $Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
@@ -1188,7 +1188,7 @@
 		$Apache::lonhomework::results{"resource.$version.0.awarded"}='1';
 		&remove_from_queue($env{'form.queue'});
 
-		my ($symb,$courseid,$udom,$uname)=&Apache::lonxml::whichuser();
+		my ($symb,$courseid,$udom,$uname)=&Apache::lonnet::whichuser();
 		if ($env{'form.regrade'} ne 'yes') {
 		    $Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"}=
 			$Apache::lonhomework::history{"resource.$version.0.bridgetask.portfiles"};
@@ -1268,7 +1268,7 @@
 sub check_queue_unlock {
     my ($queue,$key,$allow_not_me)=@_;
     if ($queue eq 'none') { return 'ok'; }
-    my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
     if (!defined($key)) {
 	$key="$symb\0queue\0$uname:$udom";
     }
@@ -1291,7 +1291,7 @@
     if ($queue eq 'none') { return 0; }
     if (!defined($symb) || !defined($cdom) || !defined($cnum)
 	|| !defined($udom) || !defined($uname)) {
-	($symb,my $cid,$udom,$uname)=&Apache::lonxml::whichuser();
+	($symb,my $cid,$udom,$uname)=&Apache::lonnet::whichuser();
 	$cnum=$env{'course.'.$cid.'.num'};
 	$cdom=$env{'course.'.$cid.'.domain'};
     }
@@ -1310,7 +1310,7 @@
     if ($queue eq 'none') { return 'ok'; }
     if (!defined($symb) || !defined($cdom) || !defined($cnum)
 	|| !defined($udom) || !defined($uname)) {
-	($symb,my $cid,$udom,$uname)=&Apache::lonxml::whichuser();
+	($symb,my $cid,$udom,$uname)=&Apache::lonnet::whichuser();
 	$cnum=$env{'course.'.$cid.'.num'};
 	$cdom=$env{'course.'.$cid.'.domain'};
     }
@@ -1335,7 +1335,7 @@
 
 sub get_queue_data {
     my ($queue,$udom,$uname)=@_;
-    my ($symb,$cid,$other_udom,$other_uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$other_udom,$other_uname)=&Apache::lonnet::whichuser();
     if (!$uname || !$udom) {
 	$uname=$other_uname;
 	$udom =$other_udom;
@@ -1381,7 +1381,7 @@
 sub add_to_queue {
     my ($queue,$user_data)=@_;
     if ($queue eq 'none') { return 'ok'; }
-    my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
     if (!$cid || $env{'request.state'} eq 'construct') {
 	return 'no_queue';
     }
@@ -1419,7 +1419,7 @@
 sub show_queue {
     my ($queue,$with_selects)=@_;
     my $result;
-    my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
 
@@ -1546,7 +1546,7 @@
 sub get_queue_counts {
     my ($queue)=@_;
     my $result;
-    my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
 
@@ -1604,7 +1604,7 @@
 sub queue_key_locked {
     my ($queue,$key,$cdom,$cnum)=@_;
     if (!defined($cdom) || !defined($cnum)) {
-	my (undef,$cid)=&Apache::lonxml::whichuser();
+	my (undef,$cid)=&Apache::lonnet::whichuser();
 	$cnum=$env{'course.'.$cid.'.num'};
 	$cdom=$env{'course.'.$cid.'.domain'};
     }
@@ -1716,7 +1716,7 @@
 sub lock_key {
     my ($queue,$todo)=@_;
     my $me=$env{'user.name'}.':'.$env{'user.domain'};
-    my (undef,$cid)=&Apache::lonxml::whichuser();
+    my (undef,$cid)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
     my $success=&Apache::lonnet::newput($queue,{"$todo\0locked"=> $me},
@@ -1731,7 +1731,7 @@
 sub get_queue_symb_status {
     my ($queue,$symb,$cdom,$cnum) = @_;
     if (!defined($cdom) || !defined($cnum)) {
-	my (undef,$cid)=&Apache::lonxml::whichuser();
+	my (undef,$cid)=&Apache::lonnet::whichuser();
 	$cnum=$env{'course.'.$cid.'.num'};
 	$cdom=$env{'course.'.$cid.'.domain'};
     }
@@ -1755,7 +1755,7 @@
 sub get_from_queue {
     my ($queue)=@_;
     my $result;
-    my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
+    my ($symb,$cid,$udom,$uname)=&Apache::lonnet::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
     my $todo=&find_mid_grade($queue,$symb,$cdom,$cnum);
@@ -1831,7 +1831,7 @@
 }
 
 sub select_user {
-    my ($symb,$cid)=&Apache::lonxml::whichuser();
+    my ($symb,$cid)=&Apache::lonnet::whichuser();
 
     my @chosen_sections=
 	&Apache::loncommon::get_env_multiple('form.chosensections');
@@ -2518,7 +2518,7 @@
 
 sub proctor_validation_screen {
     my ($slot) = @_;
-    my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
+    my (undef,undef,$domain,$user) = &Apache::lonnet::whichuser();
     my $url=&Apache::lonnet::studentphoto($domain,$user,'jpg');
     my $name=&Apache::loncommon::plainname($user,$domain);
     
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.76 loncom/homework/essayresponse.pm:1.77
--- loncom/homework/essayresponse.pm:1.76	Mon Oct 16 05:27:54 2006
+++ loncom/homework/essayresponse.pm	Tue Oct 17 11:11:11 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.76 2006/10/16 09:27:54 foxr Exp $
+# $Id: essayresponse.pm,v 1.77 2006/10/17 15:11:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,7 +147,7 @@
 #
                 if ($award eq 'SUBMITTED') {
 		    my ($symb,$crsid,$domain,$name)=
-			&Apache::lonxml::whichuser();
+			&Apache::lonnet::whichuser();
 		    if ($crsid) {
 			my $akey=$name.'.'.$domain.'.'.$crsid;
 			my $essayurl=
@@ -227,7 +227,7 @@
 	    $$uploadedflag=1;
 	}
 	if ($$award ne 'INVALID_FILETYPE' && $which eq 'portfiles') {
-	    my ($symb,$crsid,$domain,$name)=&Apache::lonxml::whichuser();
+	    my ($symb,$crsid,$domain,$name)=&Apache::lonnet::whichuser();
 	    &Apache::lonnet::unmark_as_readonly($domain,$name,[$symb,$crsid]);
 	    &Apache::lonnet::mark_as_readonly($domain,$name,\@submitted_files,[$symb,$crsid]);
 	    &Apache::lonnet::clear_selected_files($name);
@@ -241,7 +241,7 @@
 	}
     } elsif ($which eq 'portfiles' &&
 	     $Apache::lonhomework::history{"resource.$part.$id.$which"}) {
-	my ($symb,$crsid,$domain,$name)=&Apache::lonxml::whichuser();
+	my ($symb,$crsid,$domain,$name)=&Apache::lonnet::whichuser();
 	&Apache::lonnet::unmark_as_readonly($domain,$name,[$symb,$crsid]);
 	$Apache::lonhomework::results{"resource.$part.$id.$which"}="";
     }
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.208 loncom/homework/inputtags.pm:1.209
--- loncom/homework/inputtags.pm:1.208	Thu Oct 12 12:28:21 2006
+++ loncom/homework/inputtags.pm	Tue Oct 17 11:11:11 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.208 2006/10/12 16:28:21 albertel Exp $
+# $Id: inputtags.pm,v 1.209 2006/10/17 15:11:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -462,7 +462,7 @@
     }
     my (@file_list,@bad_file_list);
     foreach my $file (split(/\s*,\s*/,&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
-	my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+	my (undef,undef,$domain,$user)=&Apache::lonnet::whichuser();
 	my $url="/uploaded/$domain/$user/portfolio$file";
 	my $icon=&Apache::loncommon::icon($url);
 	push(@file_list,'<a href="'.$url.'"><img src="'.$icon.
@@ -753,7 +753,7 @@
 	$message = &mt("Unknown message").": $award";
 	$button=1;
     }
-    my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
+    my (undef,undef,$domain,$user)=&Apache::lonnet::whichuser();
     foreach my $resid(@Apache::inputtags::response){
         if ($Apache::lonhomework::history{"resource.$part.$resid.handback"}) {
 	    $message.='<br />';
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.260 loncom/homework/lonhomework.pm:1.261
--- loncom/homework/lonhomework.pm:1.260	Thu Oct  5 09:59:57 2006
+++ loncom/homework/lonhomework.pm	Tue Oct 17 11:11:11 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.260 2006/10/05 13:59:57 albertel Exp $
+# $Id: lonhomework.pm,v 1.261 2006/10/17 15:11:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -393,7 +393,7 @@
     &Apache::lonxml::debug("checking for part :$id:");
     &Apache::lonxml::debug("time:".time);
 
-    my ($symb)=&Apache::lonxml::whichuser();
+    my ($symb)=&Apache::lonnet::whichuser();
     &Apache::lonxml::debug("symb:".$symb);
     #if ($env{'request.state'} ne "construct" && $symb ne '') {
     if ($env{'request.state'} ne "construct") {
@@ -604,7 +604,7 @@
 
     if ($Apache::lonhomework::browse eq 'F' && 
 	$env{'form.devalidatecourseresdata'} eq 'on') {
-	my (undef,$courseid) = &Apache::lonxml::whichuser();
+	my (undef,$courseid) = &Apache::lonnet::whichuser();
 	&Apache::lonnet::devalidatecourseresdata($env{"course.$courseid.num"},
 					      $env{"course.$courseid.domain"});
     }
@@ -1048,7 +1048,7 @@
     }
     &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:$Apache::lonhomework::modifygrades:$Apache::lonhomework::queuegrade");
     &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});
-    my ($symb) = &Apache::lonxml::whichuser();
+    my ($symb) = &Apache::lonnet::whichuser();
     &Apache::lonxml::debug('symb is '.$symb);
     if ($env{'request.state'} eq "construct") {
 	if ( -e $file ) {
Index: loncom/homework/outputtags.pm
diff -u loncom/homework/outputtags.pm:1.48 loncom/homework/outputtags.pm:1.49
--- loncom/homework/outputtags.pm:1.48	Thu May 11 23:46:54 2006
+++ loncom/homework/outputtags.pm	Tue Oct 17 11:11:12 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # tags that create controlled output
 #
-# $Id: outputtags.pm,v 1.48 2006/05/12 03:46:54 albertel Exp $
+# $Id: outputtags.pm,v 1.49 2006/10/17 15:11:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -169,7 +169,7 @@
 sub multipart {
     my ($uri)=@_;
     if (!defined($uri)) { $uri=$env{'request.uri'}; }
-    my ($symb)=&Apache::lonxml::whichuser();
+    my ($symb)=&Apache::lonnet::whichuser();
 
     my @parts;
     my $metadata = &Apache::lonnet::metadata($uri,'packages');
@@ -236,7 +236,7 @@
 sub start_displaystudentphoto {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $result;
-    my (undef,undef,$domain,$user) = &Apache::lonxml::whichuser();
+    my (undef,undef,$domain,$user) = &Apache::lonnet::whichuser();
     if ($target eq 'web' && $user eq $env{'user.name'}) {
 	my $url=&Apache::lonnet::studentphoto($domain,$user,"gif");
 	my $args;
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.366 loncom/homework/structuretags.pm:1.367
--- loncom/homework/structuretags.pm:1.366	Fri Sep 29 16:55:33 2006
+++ loncom/homework/structuretags.pm	Tue Oct 17 11:11:12 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.366 2006/09/29 20:55:33 albertel Exp $
+# $Id: structuretags.pm,v 1.367 2006/10/17 15:11:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -142,7 +142,7 @@
 	&& $env{'request.state'} ne 'construct'
 	&& ($target eq 'web' || $target eq 'webgrade')) {
 
-	my ($symb,undef,undef,undef,$publicuser)= &Apache::lonxml::whichuser();
+	my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
 	if ($symb eq '' && !$publicuser) {
 	    my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
 	    $help=&mt("Browsing resource, all submissions are temporary.")."<br />";
@@ -181,7 +181,7 @@
     if (defined($Apache::lonhomework::name)) {
 	return $Apache::lonhomework::name;
     }
-    my ($symb)=&Apache::lonxml::whichuser();
+    my ($symb)=&Apache::lonnet::whichuser();
     my $name=&Apache::lonnet::gettitle($symb);
     if ($name eq '') {
 	$name=&Apache::lonnet::EXT('resource.title');
@@ -198,7 +198,7 @@
 sub setup_rndseed {
     my ($safeeval)=@_;
     my $rndseed;
-    my ($symb)=&Apache::lonxml::whichuser();
+    my ($symb)=&Apache::lonnet::whichuser();
     if ($env{'request.state'} eq "construct" 
 	|| $symb eq '' 
 	|| $Apache::lonhomework::type eq 'practice'
@@ -346,7 +346,7 @@
     undef(%Apache::lonhomework::results);
     undef(%Apache::lonhomework::history);
     my ($symb,$courseid,$domain,$name) = 
-	&Apache::lonxml::whichuser($given_symb);
+	&Apache::lonnet::whichuser($given_symb);
     
     # anonymous users (CODEd exams) have no data
     if ($name eq 'anonymous' 
@@ -392,7 +392,7 @@
 	my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results));
 	delete(@Apache::lonhomework::results{@remove});
 	my ($symb,$courseid,$domain,$name) = 
-	    &Apache::lonxml::whichuser($given_symb);
+	    &Apache::lonnet::whichuser($given_symb);
 	if ($env{'request.state'} eq 'construct' 
 	    || $symb eq ''
 	    || $Apache::lonhomework::type eq 'practice') {
@@ -657,7 +657,7 @@
 	}
 	#handle rand seed in construction space
 	my $rndseed=&setup_rndseed($safeeval);
-	my ($symb)=&Apache::lonxml::whichuser();
+	my ($symb)=&Apache::lonnet::whichuser();
 	if ($env{'request.state'} ne "construct" && 
 	    ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {
 	    $form_tag_start.='<input type="hidden" name="rndseed" value="'.
@@ -1654,7 +1654,7 @@
         (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
         my $url=$env{'request.noversionuri'};
         $url=~s/\?.*$//;
-	my ($symb) = &Apache::lonxml::whichuser();
+	my ($symb) = &Apache::lonnet::whichuser();
 	$result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.
                 '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').
 &Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />';
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.68 loncom/interface/slotrequest.pm:1.69
--- loncom/interface/slotrequest.pm:1.68	Fri Jun 30 00:28:18 2006
+++ loncom/interface/slotrequest.pm	Tue Oct 17 11:11:26 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.68 2006/06/30 04:28:18 albertel Exp $
+# $Id: slotrequest.pm,v 1.69 2006/10/17 15:11:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -77,7 +77,7 @@
 =cut
 
 sub get_course {
-    (undef,my $courseid)=&Apache::lonxml::whichuser();
+    (undef,my $courseid)=&Apache::lonnet::whichuser();
     my $cdom=$env{'course.'.$courseid.'.domain'};
     my $cnum=$env{'course.'.$courseid.'.num'};
     return ($cnum,$cdom);
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.422 loncom/xml/lonxml.pm:1.423
--- loncom/xml/lonxml.pm:1.422	Wed Oct  4 15:48:36 2006
+++ loncom/xml/lonxml.pm	Tue Oct 17 11:11:37 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.422 2006/10/04 19:48:36 albertel Exp $
+# $Id: lonxml.pm,v 1.423 2006/10/17 15:11:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -251,7 +251,7 @@
     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;
     }
@@ -816,7 +816,7 @@
 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");
@@ -1742,48 +1742,6 @@
   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__
 
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.137 loncom/xml/scripttag.pm:1.138
--- loncom/xml/scripttag.pm:1.137	Wed Mar 29 17:41:39 2006
+++ loncom/xml/scripttag.pm	Tue Oct 17 11:11:37 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.137 2006/03/29 22:41:39 albertel Exp $
+# $Id: scripttag.pm,v 1.138 2006/10/17 15:11:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -116,7 +116,7 @@
 	    ($env{'form.answer_output_mode'} ne 'tex') &&
 	    ($Apache::lonhomework::viewgrades == 'F')) {
 	    $Apache::lonxml::evaluate--;
-	    my (undef,undef,$udom,$uname)=&Apache::lonxml::whichuser();
+	    my (undef,undef,$udom,$uname)=&Apache::lonnet::whichuser();
 	    my $windowopen=&Apache::lonhtmlcommon::javascript_docopen();
 	    my $start_page =
 		&Apache::loncommon::start_page('Script Vars', undef,

--albertel1161097898--