[LON-CAPA-cvs] cvs: loncom /xml scripttag.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 12 Feb 2004 17:34:24 -0000


albertel		Thu Feb 12 12:34:24 2004 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - BUG#2594, viewing multiple students at a time resulted in the "Script Vars" link only showing the last students values.
  
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.108 loncom/xml/scripttag.pm:1.109
--- loncom/xml/scripttag.pm:1.108	Wed Feb 11 10:10:05 2004
+++ loncom/xml/scripttag.pm	Thu Feb 12 12:34:24 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.108 2004/02/11 15:10:05 matthew Exp $
+# $Id: scripttag.pm,v 1.109 2004/02/12 17:34:24 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,13 +118,14 @@
 	    ($ENV{'form.answer_output_mode'} ne 'tex') &&
 	    ($Apache::lonhomework::viewgrades == 'F')) {
 	    $Apache::lonxml::evaluate--;
-	    $result.="<script type=\"text/javascript\"> function LONCAPA_scriptvars_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
+	    my (undef,undef,$udom,$uname)=&Apache::lonxml::whichuser();
+	    $result.="<script type=\"text/javascript\"> function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.document.open('text/html','replace');newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
 	    my $listing=&Apache::run::dump($target,$safeeval);
 	    $listing=~s/\'/\\\'/g;
 	    $listing=~s/\n/\\n/g;
 	    $listing=~s/\r/\\r/g;
 	    $result.=$listing;
-	    $result.= "</pre></body></html>');newWindow.document.close();}</script><a href=\"javascript:LONCAPA_scriptvars_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";
+	    $result.= "</pre></body></html>');newWindow.document.close();}</script><a href=\"javascript:LONCAPA_scriptvars_".$uname."_".$udom."_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";
 	}
     } elsif ($target eq "edit" ) {
       #&Apache::run::run($bodytext,$safeeval);