[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 16 Oct 2003 15:29:45 -0000


sakharuk		Thu Oct 16 11:29:45 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Bug 2287 (automatic eps generation needs to preserves paths) is partly corrected - it's done for static images. Further neccessary steps are 1) implement the same for randomlabel. problems; 2) implement additional parameter to do previous item for a few students at the same time; 3) make a test for a few more situations.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.181 loncom/xml/londefdef.pm:1.182
--- loncom/xml/londefdef.pm:1.181	Tue Oct 14 10:40:33 2003
+++ loncom/xml/londefdef.pm	Thu Oct 16 11:29:45 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.181 2003/10/14 14:40:33 sakharuk Exp $
+# $Id: londefdef.pm,v 1.182 2003/10/16 15:29:45 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -625,8 +625,7 @@
 sub end_strong {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($target eq 'web') {
-	
+    if ($target eq 'web') {	
 	$currentstring = $token->[2];     
     } elsif ($target eq 'tex') {
 	$currentstring = '}';  
@@ -2163,7 +2162,9 @@
 		    my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
 		    $temp_file = Apache::File->new('>>'.$filename); 
 		    print $temp_file "$src\n";
-		    $currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool/}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
+		    $newsrc=~s/\/home\/httpd\/html\/res//;
+		    $newsrc=~s/\/([^\/]+)\.(ps|eps)/\//;
+		    $currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
 		}
 	    }
 	} else {