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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 14 May 2003 13:10:11 -0000


albertel		Wed May 14 09:10:11 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - should be no real change, I just ddin't like appenv form parameters, it can cause problems
  
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.165 loncom/interface/lonprintout.pm:1.166
--- loncom/interface/lonprintout.pm:1.165	Tue May 13 16:42:39 2003
+++ loncom/interface/lonprintout.pm	Wed May 14 09:10:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.165 2003/05/13 20:42:39 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.166 2003/05/14 13:10:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -481,15 +481,16 @@
       $selectionmade = 1;
       if ($ENV{'form.url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
         my %moreenv;
-        $moreenv{'form.grade_target'}='tex';
         if (&Apache::lonnet::allowed('bre',$ENV{'form.url'})) {
 	  $ENV{'form.url'}=~s/http:\/\/[^\/]+//;
         }
         $moreenv{'request.filename'}=$ENV{'form.url'};
-        $moreenv{'form.textwidth'}=$LaTeXwidth;
+	my %form;
+        $from{'textwidth'}=$LaTeXwidth;
+        $form{'grade_target'}='tex';
         &Apache::lonnet::appenv(%moreenv);
-        my $texversion=&Apache::lonnet::ssi($ENV{'form.url'});
-        &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');
+        my $texversion=&Apache::lonnet::ssi($ENV{'form.url'},%form);
+        &Apache::lonnet::delenv('form.counter');
         $result .= $texversion;
         if ($ENV{'form.url'}=~m/\.page\s*$/) {
 	  ($result,$number_of_columns) = &page_cleanup($result);
@@ -523,13 +524,12 @@
 	    } elsif ($choice eq 'Standard LaTeX output for whole primary sequence') {
               $selectionmade = 3;
 	    }
-	   my %moreenv;
-	   $moreenv{'form.grade_target'}='tex';
-	   $moreenv{'form.textwidth'}=$LaTeXwidth;
-	   &Apache::lonnet::appenv(%moreenv);
+	   my %form;
+	   $form{'textwidth'}=$LaTeXwidth;
+	   $form{'grade_target'}='tex';
+	   $form{'symb'}=$symb;
 	   #&Apache::lonnet::logthis("Trying to get $urlp with symb $symb");
-	   my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));
-	   &Apache::lonnet::delenv('form.grade_target','form.textwidth');
+	   my $texversion=&Apache::lonnet::ssi($urlp,%form);
 	   if ($urlp =~ m/\.page/) {
 	     ($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
 	     if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} 
@@ -563,12 +563,11 @@
 	     my ($urlp,$symb) = split /&&/, $file_seq[$i];
 	     $urlp=~s/\/home\/httpd\/html//;	    
 	     if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) {
-		my %moreenv;
-		$moreenv{'form.grade_target'}='tex';
-		$moreenv{'form.textwidth'}=$LaTeXwidth;
-		&Apache::lonnet::appenv(%moreenv);
-		my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$symb));
-		&Apache::lonnet::delenv('form.grade_target','form.textwidth');		    
+		my %form;
+		$form{'grade_target'}='tex';
+		$form{'textwidth'}=$LaTeXwidth;
+		$form{'symb'}=$symb;
+		my $texversion=&Apache::lonnet::ssi($urlp,%form);
 		if ($flag_latex_header_remove ne 'NO') {
 		    $texversion = &latex_header_footer_remove($texversion);
 		} else {
@@ -658,17 +657,15 @@
 	for (my $i=0;$i<=$#list_of_files;$i++) {
 	    my $urlp = $list_of_files[$i];
 	    if ($urlp=~/\//) {
-		my %moreenv;
-		$moreenv{'form.grade_target'}='tex';
-		$moreenv{'form.textwidth'}=$LaTeXwidth;
-		&Apache::lonnet::appenv(%moreenv);
+		my %form;
+		$form{'grade_target'}='tex';
+		$form{'textwidth'}=$LaTeXwidth;
 		if ($urlp =~ m|/home/([^/]+)/public_html|) {
 		    $urlp =~ s|/home/([^/]*)/public_html|/~$1|;
 		} else {
 		    $urlp =~ s|^/home/httpd/html||;
 		}
-		my $texversion=&Apache::lonnet::ssi($urlp);
-		&Apache::lonnet::delenv('form.grade_target','form.textwidth');
+		my $texversion=&Apache::lonnet::ssi($urlp,%form);
                 #this chunck is responsible for printing the path to problem
 		my $newurlp = '';
 		my $HowMany = length($urlp)*2;
@@ -1037,7 +1034,6 @@
     $result =~ s/&(Phi|\#934);/\$\\Phi \$/g;
     $result =~ s/&(Psi|\#936);/\$\\Psi \$/g;
     $result =~ s/&(Omega|\#937);/\$\\Omega \$/g;
-
     return $result;
 }
 
@@ -1375,21 +1371,19 @@
 	$selectionmade = 1;
 	if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
 	    my %moreenv;
-	    $moreenv{'form.grade_target'}='tex';
 	    $moreenv{'request.filename'}=$currentURL;
-	    $moreenv{'form.textwidth'}=$LaTeXwidth;
+	    my %form;
+	    $form{'grade_target'}='tex';
+	    $form{'textwidth'}=$LaTeXwidth;
 	    &Apache::lonnet::appenv(%moreenv);
-	    my $texversion=&Apache::lonnet::ssi($currentURL);
-	    &Apache::lonnet::delenv('form.grade_target');
-	    &Apache::lonnet::delenv('form.textwidth');
+	    my $texversion=&Apache::lonnet::ssi($currentURL,$form);
 	    &Apache::lonnet::delenv('form.counter');
+	    &Apache::lonnet::delenv('request.filename');
 	    if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
-		$moreenv{'form.grade_target'}='answer';
-		$moreenv{'form.print_answer'}='yes';
-		&Apache::lonnet::appenv(%moreenv);
-		my $answer=&Apache::lonnet::ssi($currentURL);
-		&Apache::lonnet::delenv('form.grade_target');
-		&Apache::lonnet::delenv('form.print_answer');
+		my %form;
+		$form{'grade_target'}='answer';
+		$form{'print_answer'}='yes';
+		my $answer=&Apache::lonnet::ssi($currentURL,%form);
 #		$r->print('<pre>'.$answer.'</pre>'); return OK;
 		$texversion=~s/(\\end{document})/$answer$1/;
 	    }
@@ -1423,14 +1417,12 @@
 	    } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') {
 		$selectionmade = 4;
 	    }
-	    my %moreenv;
-	    $moreenv{'form.grade_target'}='tex';
-	    $moreenv{'form.textwidth'}=$LaTeXwidth;
-	    &Apache::lonnet::appenv(%moreenv);
+	    my %form;
+	    $form{'grade_target'}='tex';
+	    $form{'textwidth'}=$LaTeXwidth;
+	    $form{'symb'}=$master_seq[$i];
 	    #&Apache::lonnet::logthis("Trying to get $urlp with symb $master_seq[$i]");
-	    my $texversion=&Apache::lonnet::ssi($urlp,('symb'=>$master_seq[$i]));
-	    &Apache::lonnet::delenv('form.grade_target');
-	    &Apache::lonnet::delenv('form.textwidth');
+	    my $texversion=&Apache::lonnet::ssi($urlp,%form);
 	    if ($urlp=~/\.page$/) {
 		($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
 		if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} 
@@ -1507,18 +1499,15 @@
 	for (my $i=0;$i<=$#list_of_files;$i++) {
 	    my $urlp = $list_of_files[$i];
 	    if ($urlp=~/\//) {
-		my %moreenv;
-		$moreenv{'form.grade_target'}='tex';
-		$moreenv{'form.textwidth'}=$LaTeXwidth;
-		&Apache::lonnet::appenv(%moreenv);
+		my %form;
+		$form{'grade_target'}='tex';
+		$form{'textwidth'}=$LaTeXwidth;
 		if ($urlp =~ m|/home/([^/]+)/public_html|) {
 		    $urlp =~ s|/home/([^/]*)/public_html|/~$1|;
 		} else {
 		    $urlp =~ s|^/home/httpd/html||;
 		}
-		my $texversion=&Apache::lonnet::ssi($urlp);
-		&Apache::lonnet::delenv('form.grade_target');
-		&Apache::lonnet::delenv('form.textwidth');
+		my $texversion=&Apache::lonnet::ssi($urlp,%form);
                 #this chunck is responsible for printing the path to problem
 		my $newurlp = '';
 		my $HowMany = length($urlp)*2;