--- loncom/homework/inputtags.pm 2008/11/25 13:16:17 1.249
+++ loncom/homework/inputtags.pm 2010/06/05 01:38:43 1.262
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.249 2008/11/25 13:16:17 jms Exp $
+# $Id: inputtags.pm,v 1.262 2010/06/05 01:38:43 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -388,12 +388,13 @@ sub start_textline {
&& $Apache::lonhomework::type ne 'exam') {
my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
if ($size != 0) {$size=$size*2; $size.=' mm';} else {$size='40 mm';}
- if ($env{'form.pdfFormFields'} eq 'yes') {
+ if ($env{'form.pdfFormFields'} eq 'yes'
+ && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
my $fieldname = $env{'request.symb'}.
'&part_'. $Apache::inputtags::part.
'&textresponse'.
'&HWVAL_' . $Apache::inputtags::response['-1'];
- $result="\n\\\\\n".'\textField{'.$fieldname.'}{'.$size.'}{12 bp}';
+ $result='\textField{'.$fieldname.'}{'.$size.'}{12 bp}';
} else {
$result='\framebox['.$size.'][s]{\tiny\strut}';
}
@@ -461,16 +462,17 @@ sub end_hiddenline {
$part -> partid
$id -> responseid
$uploadefiletypes -> comma seperated list of extensions allowed or * for any
-$which -> 'uploadedonly' -> only newly uploaded files
+$which -> 'uploadonly' -> only newly uploaded files
'portfolioonly' -> only allow files from portfolio
'both' -> allow files from either location
$extratext -> additional text to go between the link and the input box
+$maxfilesize -> maximum cumulative filesize for submitted files (in MB).
returns a table row
=cut
sub file_selector {
- my ($part,$id,$uploadedfiletypes,$which,$extratext)=@_;
+ my ($part,$id,$uploadedfiletypes,$which,$extratext,$maxfilesize)=@_;
if (!$uploadedfiletypes) { return ''; }
my $jspart=$part;
@@ -479,9 +481,16 @@ sub file_selector {
my $result;
$result.='
';
- 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)').
@@ -498,7 +507,6 @@ sub file_selector {
''.
' ';
$result .= &show_past_portfile_submission($part,$id);
-
}
$result.='
';
return $result;
@@ -516,7 +524,7 @@ sub show_past_file_submission {
my $icon=&Apache::loncommon::icon($url);
my $curfile=''.$uploadedfile.'';
- return &mt('Currently submitted: [_1]',$curfile);
+ return &mt('Currently submitted: [_1]',''.$curfile.'');
}
@@ -546,7 +554,9 @@ sub show_past_portfile_submission {
my $bad_files = ''.
join(', ',@bad_file_list).
'';
- $result.=' '.&mt('These file(s) don\'t exist: [_1]',$bad_files);
+ $result.='