--- loncom/homework/essayresponse.pm 2004/12/06 18:09:54 1.52
+++ loncom/homework/essayresponse.pm 2004/12/16 21:21:35 1.56
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.52 2004/12/06 18:09:54 banghart Exp $
+# $Id: essayresponse.pm,v 1.56 2004/12/16 21:21:35 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,13 +65,11 @@ sub start_essayresponse {
$result .='';
}
if ($uploadedfiletypes) {
- $result.='
'.&mt('Submit a file:').
+ $result.=' |
'.&mt('Submit a file: (only one file can be uploaded)').
'
'.
+ $part.'_'.$id.'" /> '.
&mt('Allowed filetypes: [_1]',$uploadedfiletypes).' '.
- 'OR: Select Portfolio Files'.
+ 'OR: Select Portfolio Files'.
' '.
''.
' ';
@@ -126,18 +124,21 @@ sub end_essayresponse {
}
my $uploadedflag=0;
if ($filename =~ /[^\s]/) {
- my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");
- $uploadedfiletypes=~s/[^\w\,]//g;
- $uploadedfiletypes=','.$uploadedfiletypes.',';
- my ($extension)=($filename=~/\.(\w+)$/);
- if ($uploadedfiletypes=~/\,$extension\,/i) {
- $Apache::lonhomework::results{"resource.$part.$id.uploadedfile"}=$filename;
- $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}=
- &Apache::lonnet::userfileupload('HWFILE'.$part.'_'.$id,undef,'essayresponse');
- $uploadedflag=1;
- } else {
- $award='INVALID_FILETYPE';
- }
+ my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");
+ $uploadedfiletypes=~s/[^\w\,]//g;
+ $uploadedfiletypes=','.$uploadedfiletypes.',';
+ my ($extension)=($filename=~/\.(\w+)$/);
+ if ($uploadedfiletypes=~/\,$extension\,/i) {
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedfile"}=$filename;
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}=
+ &Apache::lonnet::userfileupload('HWFILE'.$part.'_'.$id,undef,'essayresponse');
+ $uploadedflag=1;
+ } else {
+ $award='INVALID_FILETYPE';
+ }
+ } else {
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedfile"}="";
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}="";
}
if ($portfiles =~ /[^\s]/) {
$portfiles =~s/,$//;
@@ -148,6 +149,8 @@ sub end_essayresponse {
&Apache::lonnet::mark_as_readonly($domain,$name,\@submitted_files,$dsymb.$crsid);
&Apache::lonnet::clear_selected_files($name);
$uploadedflag=1;
+ } else {
+ $Apache::lonhomework::results{"resource.$part.$id.portfiles"}="";
}
$Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;
$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$award;
|