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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 09 Oct 2003 19:15:25 -0000


sakharuk		Thu Oct  9 15:15:25 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Changes in printing the path to problem in the construction space are done - I have forgotten to do this earlier.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.252 loncom/interface/lonprintout.pm:1.253
--- loncom/interface/lonprintout.pm:1.252	Mon Oct  6 09:19:57 2003
+++ loncom/interface/lonprintout.pm	Thu Oct  9 15:15:25 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.252 2003/10/06 13:19:57 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.253 2003/10/09 19:15:25 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -656,6 +656,8 @@
 		}
 	    }
 	}
+    } else {
+	$newurlp=$urlp;
     }
     return '{\small\noindent\verb|'.$newurlp.'|\vskip 0 mm}';
 }
@@ -995,6 +997,7 @@
 	}
 	for (my $i=0;$i<=$#list_of_files;$i++) {
 	    my $urlp = $list_of_files[$i];
+	    $urlp=~s|//|/|;
 	    if ($urlp=~/\//) {
 		my %form;
 		$form{'grade_target'}='tex';
@@ -1007,7 +1010,7 @@
 		}
 		my $texversion=&Apache::lonnet::ssi($urlp,%form);
 		if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
-			   ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
+		   ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
 		    my %form;
 		    $form{'grade_target'}='answer';
 		    $form{'answer_output_mode'}='tex';
@@ -1017,21 +1020,23 @@
 		    if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
 			$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 		    } else {
-		    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
-		    if ($helper->{'VARS'}->{'construction'} ne '1') {
-			$texversion.='\vskip 0 mm \noindent ';
-			$texversion.=&path_to_problem ($urlp,$LaTeXwidth);
-		    } else {
-			$texversion.='\vskip 0 mm \noindent\textbf{Prints from construction space - there is no title.}\vskip 0 mm ';
-			my $URLpath=$urlp;
-			$URLpath=~s/~([^\/]+)/public_html\/$1\/$1/;
-			$texversion.=&path_to_problem ($URLpath,$LaTeXwidth);
+			$texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+			if ($helper->{'VARS'}->{'construction'} ne '1') {
+			    $texversion.='\vskip 0 mm \noindent ';
+			    $texversion.=&path_to_problem ($urlp,$LaTeXwidth);
+			} else {
+			    $texversion.='\vskip 0 mm \noindent\textbf{Prints from construction space - there is no title.}\vskip 0 mm ';
+			    my $URLpath=$urlp;
+			    $URLpath=~s/~([^\/]+)/public_html\/$1\/$1/;
+			    $texversion.=&path_to_problem ($URLpath,$LaTeXwidth);
+			}
+			$texversion.='\vskip 1 mm '.$answer.'\end{document}';
 		    }
-		    $texversion.='\vskip 1 mm '.$answer.'\end{document}';
-		}
 		}
                 #this chunck is responsible for printing the path to problem
-		my $newurlp=&path_to_problem($urlp,$LaTeXwidth);
+		my $newurlp=$urlp;
+		if ($newurlp=~/~/) {$newurlp=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|;}
+		$newurlp=&path_to_problem($newurlp,$LaTeXwidth);
 		$texversion =~ s/(\\begin{minipage}{\\textwidth})/$1 $newurlp/;
 		if ($flag_latex_header_remove ne 'NO') {
 		    $texversion = &latex_header_footer_remove($texversion);