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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 13 May 2003 20:42:39 -0000


sakharuk		Tue May 13 16:42:39 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
   Chenges to print single resource with answers. I still used addition to the environment (hope temporarily) - I'llworkwith ssihash later on.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.164 loncom/interface/lonprintout.pm:1.165
--- loncom/interface/lonprintout.pm:1.164	Tue May 13 11:28:32 2003
+++ loncom/interface/lonprintout.pm	Tue May 13 16:42:39 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.164 2003/05/13 15:28:32 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.165 2003/05/13 20:42:39 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1380,16 +1380,16 @@
 	    $moreenv{'form.textwidth'}=$LaTeXwidth;
 	    &Apache::lonnet::appenv(%moreenv);
 	    my $texversion=&Apache::lonnet::ssi($currentURL);
-	    &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');
+	    &Apache::lonnet::delenv('form.grade_target');
+	    &Apache::lonnet::delenv('form.textwidth');
+	    &Apache::lonnet::delenv('form.counter');
 	    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','form.print_answer');
-		my $start=index($answer,'\vskip 0 mm',0);
-		my $finish=rindex $answer,'\vskip 0 mm' ;
-		if ($start!=-1 && $finish!=-1) {$answer=substr($answer,$start,$finish-$start+12);}
+		&Apache::lonnet::delenv('form.grade_target');
+		&Apache::lonnet::delenv('form.print_answer');
 #		$r->print('<pre>'.$answer.'</pre>'); return OK;
 		$texversion=~s/(\\end{document})/$answer$1/;
 	    }
@@ -1429,7 +1429,8 @@
 	    &Apache::lonnet::appenv(%moreenv);
 	    #&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','form.textwidth');
+	    &Apache::lonnet::delenv('form.grade_target');
+	    &Apache::lonnet::delenv('form.textwidth');
 	    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;} 
@@ -1516,7 +1517,8 @@
 		    $urlp =~ s|^/home/httpd/html||;
 		}
 		my $texversion=&Apache::lonnet::ssi($urlp);
-		&Apache::lonnet::delenv('form.grade_target','form.textwidth');
+		&Apache::lonnet::delenv('form.grade_target');
+		&Apache::lonnet::delenv('form.textwidth');
                 #this chunck is responsible for printing the path to problem
 		my $newurlp = '';
 		my $HowMany = length($urlp)*2;