version 1.340, 2006/03/24 18:05:47
|
version 1.341, 2006/03/25 23:54:07
|
Line 2404 sub handback_files {
|
Line 2404 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); |
my @dir_list = &Apache::lonnet::dirlist($directory,$domain,$stuname,$portfolio_root); |
$directory =~ /^.+$stuname\/portfolio(.*)/; |
|
my $portfolio_path = $1; |
|
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, $directory, $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 |
# set the filename to match the submitted file name |
$env{'form.'.$newflg.'_'.$part_resp.'_returndoc1.filename'} = $env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}; |
$env{'form.'.$newflg.'_'.$part_resp.'_returndoc1.filename'} = $env{'form.'.$newflg.'_'.$part_resp.'_origdoc'.$file_counter}; |
my $result=&Apache::lonnet::userfileupload($newflg.'_'.$part_resp.'_returndoc'.$file_counter,'', |
my $result=&Apache::lonnet::userfileupload($newflg.'_'.$part_resp.'_returndoc'.$file_counter,'', |
Line 2538 sub version_portfiles {
|
Line 2539 sub version_portfiles {
|
} |
} |
|
|
sub get_next_version { |
sub get_next_version { |
my ($answer_name, $answer_ext, $dir_list); |
my ($answer_name, $answer_ext, $dir_list) = @_; |
my $version; |
my $version; |
foreach my $row (@$dir_list) { |
foreach my $row (@$dir_list) { |
my ($file) = split(/\&/,$row,2); |
my ($file) = split(/\&/,$row,2); |