version 1.354, 2006/05/18 21:39:27
|
version 1.355, 2006/05/28 16:47:02
|
Line 2442 sub handback_files {
|
Line 2442 sub handback_files {
|
($env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter} =~ /^(.*?)([^\/]*)$/); |
($env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter} =~ /^(.*?)([^\/]*)$/); |
my ($answer_name,$answer_ver,$answer_ext) = |
my ($answer_name,$answer_ver,$answer_ext) = |
&file_name_version_ext($answer_file); |
&file_name_version_ext($answer_file); |
$directory =~ /^.+$stuname\/portfolio(.*)/; |
my ($portfolio_path) = ($directory =~ /^.+$stuname\/portfolio(.*)/); |
my $portfolio_path = $1; |
|
my @dir_list = &Apache::lonnet::dirlist($portfolio_path,$domain,$stuname,$portfolio_root); |
my @dir_list = &Apache::lonnet::dirlist($portfolio_path,$domain,$stuname,$portfolio_root); |
my $version = &get_next_version($answer_name, $answer_ext, \@dir_list); |
my $version = &get_next_version($answer_name, $answer_ext, \@dir_list); |
my $new_answer = &version_selected_portfile($domain, $stuname, $portfolio_path, $answer_file, $version); |
my $new_answer = &version_selected_portfile($domain, $stuname, $portfolio_path, $answer_file, $version); |
$$newrecord{"resource.$new_part.$resp_id.handback"} = $new_answer; |
$$newrecord{"resource.$new_part.$resp_id.handback"} = $new_answer; |
# set the filename to match the submitted file name |
$version++; |
$env{'form.'.$newflg.'_'.$part_resp.'_returndoc1.filename'} = $env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}; |
# fix file name |
my $result=&Apache::lonnet::userfileupload($newflg.'_'.$part_resp.'_returndoc'.$file_counter,'', |
my ($save_file_name) = (($directory.$answer_name.".$version.".$answer_ext) =~ /^.+\/${stuname}\/(.*)/); |
'portfolio',undef,undef,undef,$stuname,$domain); |
my $result=&Apache::lonnet::finishuserfileupload($stuname,$domain, |
|
$newflg.'_'.$part_resp.'_returndoc'.$file_counter, |
|
$save_file_name); |
if ($result !~ m|^/uploaded/|) { |
if ($result !~ m|^/uploaded/|) { |
$request->print('<font color="red"> An errror occured ('.$result. |
$request->print('<font color="red"> An errror occured ('.$result. |
') while trying to upload '.&display_file().'</font><br />'); |
') while trying to upload '.$newflg.'_'.$part_resp.'_returndoc'.$file_counter.'</font><br />'); |
# $request->print(&done('Back')); |
|
} |
} |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print("<br />".$fname." will be the uploaded file name"); |
$request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |
$request->print(" ".$env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}); |