--- loncom/homework/essayresponse.pm 2004/12/14 18:44:56 1.53
+++ 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.53 2004/12/14 18:44:56 banghart Exp $
+# $Id: essayresponse.pm,v 1.56 2004/12/16 21:21:35 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -65,11 +65,9 @@ sub start_essayresponse {
$result .='';
}
if ($uploadedfiletypes) {
- $result.='
'.&mt('Submit a file:').
+ $result.=' |
'.&mt('Submit a file: (only one file can be uploaded)').
'
'.
- $part.'_'.$id.'" '.
+ $part.'_'.$id.'" /> '.
&mt('Allowed filetypes: [_1]',$uploadedfiletypes).' '.
'OR: Select Portfolio Files'.
' '.
@@ -117,7 +115,6 @@ sub end_essayresponse {
my $response = $ENV{'form.HWVAL_'.$id};
my $filename= $ENV{'form.HWFILE'.$part.'_'.$id.'.filename'};
my $portfiles = $ENV{'form.HWPORT'.$part.'_'.$id};
- &Apache::lonnet::logthis("portfiles now $portfiles");
if (( $response =~ /[^\s]/) || ($filename =~ /[^\s]/) || ($portfiles =~ /[^\s]/)) {
my $award;
if ($ENV{'form.HWDRAFT'.$part.'_'.$id} eq 'yes') {
@@ -127,19 +124,18 @@ sub end_essayresponse {
}
my $uploadedflag=0;
if ($filename =~ /[^\s]/) {
- &Apache::lonnet::logthis("the file to upload is $filename");
- 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"}="";
|