[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jan 2004 19:51:30 -0000


sakharuk		Thu Jan 15 14:51:30 2004 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  Bug 2587 (Imageresponse does not generate eps file on print for students) is fixed. This bug is due to the change in the path to dynamically produced eps pictures (now it is full, not only eps file in /home/httpd/prtspool). I've implemented changes in londefdef.pm for static pictures and in randomlabel.pm for randomlab. pictures but has forgotten about imageresponse.pm. Now seem to me everything is fine. 
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.44 loncom/homework/imageresponse.pm:1.45
--- loncom/homework/imageresponse.pm:1.44	Wed Jan 14 17:59:18 2004
+++ loncom/homework/imageresponse.pm	Thu Jan 15 14:51:30 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.44 2004/01/14 22:59:18 albertel Exp $
+# $Id: imageresponse.pm,v 1.45 2004/01/15 19:51:30 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -473,7 +473,11 @@
 	    my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
 	    $temp_file = Apache::File->new('>>'.$filename); 
 	    print $temp_file "$src\n";
-	    $Apache::response::foilgroup{"$name.image"} ='\vskip 0 mm \graphicspath{{/home/httpd/prtspool/}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
+	    $newsrc=~s/\/home\/httpd\/html\/res//;
+	    $newsrc=~s/\/home\/([^\/]*)\/public_html\//\/$1\//;
+	    $newsrc=~s/\/\.\//\//;
+	    $newsrc=~s/\/([^\/]+)\.(ps|eps)/\//;
+	    $Apache::response::foilgroup{"$name.image"} ='\vskip 0 mm \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
 	}
     } 
     return $result;