[LON-CAPA-cvs] cvs: loncom /xml lonplot.pm
raeburn
raeburn at source.lon-capa.org
Wed Sep 21 07:49:48 EDT 2022
raeburn Wed Sep 21 11:49:48 2022 EDT
Modified files:
/loncom/xml lonplot.pm
Log:
- Eliminate possibility of the same filename being used for different
plots in a problem which includes multiple gnuplot tags so rendering
for tex target will not use a later plot when rendering an earlier one.
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.184 loncom/xml/lonplot.pm:1.185
--- loncom/xml/lonplot.pm:1.184 Sun Feb 2 20:12:31 2020
+++ loncom/xml/lonplot.pm Wed Sep 21 11:49:48 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Dynamic plot
#
-# $Id: lonplot.pm,v 1.184 2020/02/02 20:12:31 raeburn Exp $
+# $Id: lonplot.pm,v 1.185 2022/09/21 11:49:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -40,6 +40,7 @@
use Apache::edit;
use Apache::lonnet;
use Apache::lonlocal;
+use Time::HiRes qw(gettimeofday);
use LONCAPA;
use vars qw/$weboutputformat $version $colorprefix/;
@@ -728,8 +729,9 @@
&check_inputs(); # Make sure we have all the data we need
##
## Determine filename
+ my ($seconds, $microseconds) = gettimeofday;
my $filename = $env{'user.name'}.'_'.$env{'user.domain'}.
- '_'.time.'_'.$$.$randnumber.'_plot';
+ '_'.$seconds.'_'.$microseconds.'_'.$$.$randnumber.'_plot';
## Write the plot description to the file
&write_gnuplot_file($tmpdir,$filename,$target);
$filename = &escape($filename);
More information about the LON-CAPA-cvs
mailing list