';
- if ($uploadedfiletypes ne '*') {
- $result.=
- &mt('Allowed filetypes: [_1]',$uploadedfiletypes).' ';
+ if (($uploadedfiletypes ne '*') || ($maxfilesize)) {
+ if ($uploadedfiletypes ne '*') {
+ $result.=
+ &mt('Allowed filetypes: [_1]',''.$uploadedfiletypes.'').' ';
+ }
+ if ($maxfilesize) {
+ $result.=&mt('Combined size of files not to exceed: [_1] MB[_2].',
+ ''.$maxfilesize.'').' ';
+ }
+ $result .= ' ';
}
if ($which eq 'uploadonly' || $which eq 'both') {
$result.=&mt('Submit a file: (only one file can be uploaded)').
'
';
- my $uploadedfile= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"},'<>&"');
-
- if ($uploadedfile) {
- my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
- &Apache::lonxml::extlink($url);
- &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
- my $icon=&Apache::loncommon::icon($url);
- my $curfile=''.$uploadedfile.'';
- $result.=&mt('Currently submitted: [_1]',$curfile);
- } else {
- #$result.=&mt('(Hand in a file you have prepared on your computer)');
- }
+ $result .= &show_past_file_submission($part,$id);
}
if ( $which eq 'both') {
$result.=' '.''.&mt('OR:').' ';
}
if ($which eq 'portfolioonly' || $which eq 'both') {
- $result.=$extratext.''.
+ $result.=$extratext.''.
&mt('Select Portfolio Files').' '.
''.
' ';
- if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){
- my @filelist;
- foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
- my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
- my $url="/uploaded/$domain/$user/portfolio$file";
- my $icon=&Apache::loncommon::icon($url);
- push(@filelist,''.$file.'');
- }
- $result.=&mt("Portfolio files previously selected: [_1]",join(', ',@filelist));
- }
+ $result .= &show_past_portfile_submission($part,$id);
}
$result.=' |
';
return $result;
}
-sub checkstatus {
- my ($value,$awardref,$msgref)=@_;
- for (my $i=0;$i<=$#$awardref;$i++) {
- if ($$awardref[$i] eq $value) {
- return ($$awardref[$i],$$msgref[$i]);
- }
+sub show_past_file_submission {
+ my ($part,$id) = @_;
+ my $uploadedfile= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"},'<>&"');
+
+ return if (!$uploadedfile);
+
+ my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
+ &Apache::lonxml::extlink($url);
+ &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
+ my $icon=&Apache::loncommon::icon($url);
+ my $curfile='