--- loncom/xml/lonxml.pm 2003/08/11 20:05:53 1.270 +++ loncom/xml/lonxml.pm 2003/08/13 14:23:37 1.271 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.270 2003/08/11 20:05:53 albertel Exp $ +# $Id: lonxml.pm,v 1.271 2003/08/13 14:23:37 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -69,6 +69,7 @@ use Safe::Hole(); use Math::Cephes(); use Math::Random(); use Opcode(); +use POSIX qw(strftime); sub register { @@ -1137,8 +1138,10 @@ sub storefile { if (my $fh=Apache::File->new('>'.$file)) { print $fh $contents; $fh->close(); + return 1; } else { - &warning("Unable to save file $file"); + &warning("Unable to save file $file"); + return 0; } } @@ -1242,7 +1245,9 @@ sub handler { # unless ($ENV{'request.state'} eq 'published') { if (($ENV{'form.savethisfile'}) || ($ENV{'form.attemptclean'})) { - &storefile($file,$ENV{'form.filecont'}); + if (&storefile($file,$ENV{'form.filecont'})) { + $request->print("Updated: ". strftime("%d %b %H:%M:%S",localtime())." "); + } } } my %mystyle;