--- loncom/homework/essayresponse.pm 2009/01/01 16:45:32 1.97 +++ loncom/homework/essayresponse.pm 2009/01/21 16:17:35 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # essay (ungraded) style responses # -# $Id: essayresponse.pm,v 1.97 2009/01/01 16:45:32 raeburn Exp $ +# $Id: essayresponse.pm,v 1.99 2009/01/21 16:17:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -267,7 +267,7 @@ sub file_submission { } my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); - if ($uploadedfiletypes) { + if ($uploadedfiletypes ne '') { $uploadedfiletypes=~s/[^\w\,]//g; $uploadedfiletypes=','.$uploadedfiletypes.','; foreach my $file (@submitted_files) { @@ -281,6 +281,10 @@ sub file_submission { } } } + } else { + foreach my $file (@submitted_files) { + push(@acceptable_files,$file); + } } my $maxfilesize=&Apache::lonnet::EXT("resource.$part".'_'."$id.maxfilesize"); if (!$maxfilesize) { @@ -378,7 +382,7 @@ sub file_submission { $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}= &Apache::lonnet::userfileupload('HWFILE'.$jspart.'_'.$id,undef, $subdir); - &Apache::lonnet::delenv($env{'form.HWFILE'.$jspart.'_'.$id}); + delete($env{'form.HWFILE'.$jspart.'_'.$id}); } } elsif ($which eq 'portfiles' && $Apache::lonhomework::history{"resource.$part.$id.$which"}) { @@ -390,9 +394,9 @@ sub file_submission { sub delete_form_items { my ($jspart,$id) = @_; - &Apache::lonnet::delenv($env{'form.HWFILE'.$jspart.'_'.$id.'.filename'}); - &Apache::lonnet::delenv($env{'form.HWFILE'.$jspart.'_'.$id.'.mimetype'}); - &Apache::lonnet::delenv($env{'form.HWFILE'.$jspart.'_'.$id}); + delete($env{'form.HWFILE'.$jspart.'_'.$id.'.filename'}); + delete($env{'form.HWFILE'.$jspart.'_'.$id.'.mimetype'}); + delete($env{'form.HWFILE'.$jspart.'_'.$id}); }