[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 26 Sep 2007 19:30:31 -0000


albertel		Wed Sep 26 15:30:31 2007 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - need to uniquify the function names for when problems are included
     in to .pages with the .pageing prefix
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.230 loncom/homework/inputtags.pm:1.231
--- loncom/homework/inputtags.pm:1.230	Tue Sep 18 18:18:41 2007
+++ loncom/homework/inputtags.pm	Wed Sep 26 15:30:30 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.230 2007/09/18 22:18:41 albertel Exp $
+# $Id: inputtags.pm,v 1.231 2007/09/26 19:30:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1240,12 +1240,15 @@
 				        'inherit_jsmath' => 1, });
     my $end_page =
 	&Apache::loncommon::end_page({'js_ready' => 1,});
-    
+    my $prefix = $env{'form.request.prefix'};
+    $prefix =~ tr{.}{_};
+    my $function_name = "LONCAPA_previous_tries_".$prefix.
+	$Apache::lonxml::curdepth;
     my $result ="<script type=\"text/javascript\">
 // <![CDATA[
-    function LONCAPA_previous_tries_$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page $output $end_page');newWindow.document.close();newWindow.focus()}
+    function $function_name() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('$start_page $output $end_page');newWindow.document.close();newWindow.focus()}
 // ]]>
-</script><a href=\"javascript:LONCAPA_previous_tries_$Apache::lonxml::curdepth();void(0);\">".&mt("Previous Tries")."</a><br />";
+</script><a href=\"javascript:$function_name();void(0);\">".&mt("Previous Tries")."</a><br />";
     #use Data::Dumper;
     #&Apache::lonnet::logthis(&Dumper(\%Apache::inputtags::submission_display));
     return $result;