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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 28 Jan 2004 20:00:26 -0000


sakharuk		Wed Jan 28 15:00:26 2004 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  Implementation of the function call for dynamical generation of eps.
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.45 loncom/homework/imageresponse.pm:1.46
--- loncom/homework/imageresponse.pm:1.45	Thu Jan 15 14:51:30 2004
+++ loncom/homework/imageresponse.pm	Wed Jan 28 15:00:26 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.45 2004/01/15 19:51:30 sakharuk Exp $
+# $Id: imageresponse.pm,v 1.46 2004/01/28 20:00:26 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -33,6 +33,7 @@
 use strict;
 use Image::Magick;
 use Apache::randomlylabel;
+use Apache::londefdef;
 use Apache::Constants qw(:common :http);
 
 BEGIN {
@@ -469,15 +470,8 @@
 		$Apache::response::foilgroup{"$name.image"} ='\vskip 0 mm \noindent\graphicspath{{'.$path.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
 	    }
 	} else {
-	    my $temp_file;
-	    my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat";
-	    $temp_file = Apache::File->new('>>'.$filename); 
-	    print $temp_file "$src\n";
-	    $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.'} ';
+	    #care about eps dynamical generation
+	    $Apache::response::foilgroup{"$name.image"}='\vskip 0 mm '.&Apache::londefdef::eps_generation($src,$file,$width_param);
 	}
     } 
     return $result;