--- rat/lonratedt.pm 2002/08/31 00:42:30 1.34
+++ rat/lonratedt.pm 2002/09/02 15:27:08 1.35
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Edit Handler for RAT Maps
#
-# $Id: lonratedt.pm,v 1.34 2002/08/31 00:42:30 www Exp $
+# $Id: lonratedt.pm,v 1.35 2002/09/02 15:27:08 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -331,10 +331,16 @@ sub startfinish {
sub storemap {
my $realfn=shift;
- my $fn=$realfn.'.tmp';
- unless (-e $fn) {
- copy($realfn,$fn);
+ my $fn=$realfn;
+# unless this is forced to work from the original file, use a temporary file
+# instead
+ unless (shift) {
+ $fn=$realfn.'.tmp';
+ unless (-e $fn) {
+ copy($realfn,$fn);
+ }
}
+# store data either into tmp or real file
&startfinish();
my $output='graphdef<:>no';
my $k=1;
@@ -474,10 +480,14 @@ sub smpedt {
$targetmsg='Saving ...
';
copy($tmpfn,&Apache::lonnet::filelocation('',$url));
unlink($tmpfn);
+ my ($errtext,$fatal)=
+ &mapread(&Apache::lonnet::filelocation('',$url),'');
}
if ($ENV{'form.revert'}) {
$targetmsg='Reverting ...
';
unlink($tmpfn);
+ my ($errtext,$fatal)=
+ &mapread(&Apache::lonnet::filelocation('',$url),'');
}
if (-e $tmpfn) {
$targetmsg=