--- loncom/xml/lonplot.pm 2001/12/20 20:24:36 1.11 +++ loncom/xml/lonplot.pm 2001/12/20 22:36:35 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.11 2001/12/20 20:24:36 matthew Exp $ +# $Id: lonplot.pm,v 1.12 2001/12/20 22:36:35 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,7 +34,7 @@ use Apache::File; use Apache::response; use Apache::lonxml; -use Digest::MD5 qw(md5 md5_hex md5_base64); +use Digest::MD5 qw(md5_base64); sub BEGIN { &Apache::lonxml::register('Apache::lonplot',('plot')); @@ -158,17 +158,19 @@ sub end_plot { ## Determine filename -- Need to use the 'id' thingy that Gerd ## mentioned. my $tmpdir = '/home/httpd/perl/tmp/'; - my $filename = $tmpdir.$ENV{'user.name'}.'_'.$ENV{'user.domain'}. + my $filename = $ENV{'user.name'}.'_'.$ENV{'user.domain'}. '_plot.data'; - my $usersees=md5_base64($filename.'_'.$ENV{'REMOTE_ADDR'}); - ## Write the plot description to the file - my $fh=Apache::File->new('/home/httpd/perl/tmp/'.$filename); + my $fh=Apache::File->new(">$tmpdir$filename"); $result .= '
';
-	$result .= &write_gnuplot_file($fh);
+	$result .= $filename.$/;
+	print $fh &write_gnuplot_file();
 	$result .= '
'.$/; ## return image tag for the plot - $result .= ''; + $result .= <<"ENDIMAGE"; +/cgi-bin/plot.gif?$filename +ENDIMAGE } return $result; } @@ -419,7 +421,6 @@ sub get_attributes{ } sub write_gnuplot_file { - my $fh = shift; my $gnuplot_input = ''; my $curve; # Collect all the colors @@ -500,7 +501,6 @@ ENDLABELS } $gnuplot_input .= $/.$datatext; return $gnuplot_input; -# print $fh $gnuplot_input; } 1;