--- rat/lonratsrv.pm 2002/08/19 21:15:08 1.21 +++ rat/lonratsrv.pm 2003/02/03 18:03:53 1.24 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Server for RAT Maps # -# $Id: lonratsrv.pm,v 1.21 2002/08/19 21:15:08 www Exp $ +# $Id: lonratsrv.pm,v 1.24 2003/02/03 18:03:53 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,6 @@ # 05/29/00,05/30 Gerd Kortemeyer) # 7/1 Gerd Kortemeyer) # 7/1,7/3,7/4,7/7,7/8,7/10,7/26,10/2 Gerd Kortemeyer -# 4/30/2001 Scott Harrison # 5/3,06/25,07/03,07/04,07/05 Gerd Kortemeyer package Apache::lonratsrv; @@ -205,8 +204,8 @@ sub savemap { my ($fn,$errtext)=@_; my %alltypes; my %allvalues; - if (($fn=~/\.sequence$/) || - ($fn=~/\.page$/)) { + if (($fn=~/\.sequence(\.tmp)*$/) || + ($fn=~/\.page(\.tmp)*$/)) { # ------------------------------------------------------------- Deal with input my @tags=split(/<&>/,$ENV{'form.output'}); @@ -218,7 +217,7 @@ sub savemap { } else { $outstr="\n"; } - map { + foreach (@tags) { my @parts=split(/<:>/,$_); if ($parts[0] eq 'objcont') { my @comp=split(/:/,$parts[$#parts]); @@ -289,14 +288,13 @@ sub savemap { $outstr.=' value="'.qtescape($parts[$#parts]).'">\n"; } - } @tags; + } $outstr.="\n"; - if ($fn=~/^\/*uploaded\//) { + if ($fn=~/^\/*uploaded\/(\w+)\/(\w+)\//) { $ENV{'form.output'}=$outstr; + my $home=&Apache::lonnet::homeserver($2,$1); &Apache::lonnet::finishuserfileupload( - $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, - $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, - $ENV{'course.'.$ENV{'request.course.id'}.'.home'}, + $2,$1,$home, 'output',(split(/\//,$fn))[-1]); } else { my $fh;