[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 06 Sep 2003 17:21:17 -0000


albertel		Sat Sep  6 13:21:17 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - Alex accidently removed my changes 
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.229 loncom/interface/lonprintout.pm:1.230
--- loncom/interface/lonprintout.pm:1.229	Fri Sep  5 15:42:00 2003
+++ loncom/interface/lonprintout.pm	Sat Sep  6 13:21:16 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.229 2003/09/05 19:42:00 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.230 2003/09/06 17:21:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -670,6 +670,9 @@
 	    $form{'problem_split'}=$parmhash{'problem_stream_switch'};
 	    $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
 	    my $rndseed=time;
+	    if ($helper->{'VARS'}->{'curseed'}) {
+		$rndseed=$helper->{'VARS'}->{'curseed'};
+	    }
 	    $form{'rndseed'}=$rndseed;
 	    &Apache::lonnet::appenv(%moreenv);
 	    &Apache::lonnet::delenv('form.counter');
@@ -884,6 +887,9 @@
 	@list_of_files=sort @list_of_files;
 	my $flag_latex_header_remove = 'NO'; 
 	my $rndseed=time;
+	if ($helper->{'VARS'}->{'curseed'}) {
+	    $rndseed=$helper->{'VARS'}->{'curseed'};
+	}
 	for (my $i=0;$i<=$#list_of_files;$i++) {
 	    my $urlp = $list_of_files[$i];
 	    if ($urlp=~/\//) {
@@ -1059,6 +1065,7 @@
     my $helper = Apache::lonhelper::helper->new("Printing Helper");
     $helper->declareVar('symb');
     $helper->declareVar('postdata');    
+    $helper->declareVar('curseed');    
     $helper->declareVar('filename');
     $helper->declareVar('construction');
     $helper->declareVar('assignment');
@@ -1114,6 +1121,9 @@
         }
         $subdir = &Apache::lonnet::filelocation("", $url);
     }
+    if (!$helper->{VARS}->{'curseed'} && $ENV{'form.curseed'}) {
+	$helper->{VARS}->{'curseed'}=$ENV{'form.curseed'};
+    }
 
     my $userCanSeeHidden = Apache::lonnavmaps::advancedUser();
 
@@ -1330,6 +1340,18 @@
 				     ['Yes', 'yes'] ];
 	    Apache::lonhelper::dropdown->new();
 	    addMessage("</td></tr>");
+	}
+	if ($helper->{'VARS'}->{'construction'}) { 
+	    my $xmlfrag .= <<'RNDSEED';
+	    <message><tr><td align='right'>Use random seed: </td><td></message>
+	    <string variable="curseed" size="15" maxlength="15">
+		<defaultvalue>
+	            return $helper->{VARS}->{'curseed'};
+	        </defaultvalue>
+	     </string>
+             <message></td></tr></message>
+RNDSEED
+            &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);
 	}
     }