--- loncom/homework/essayresponse.pm 2003/01/23 19:32:36 1.18
+++ loncom/homework/essayresponse.pm 2003/01/24 18:30:54 1.20
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.18 2003/01/23 19:32:36 www Exp $
+# $Id: essayresponse.pm,v 1.20 2003/01/24 18:30:54 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,6 +31,7 @@
package Apache::essayresponse;
use strict;
use Apache::lonxml;
+use Apache::lonnet;
BEGIN {
&Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
@@ -62,8 +63,15 @@ sub start_essayresponse {
if ($uploadedfiletypes) {
$result.=
'
Submit a file: Allowed filetypes: '.$uploadedfiletypes.' (Hand in a file you have prepared on your computer) |
';
+ $part.'_'.$id.'" onFocus="this.form.enctype='.
+"'multipart/form-data'".';" />
Allowed filetypes: '.$uploadedfiletypes.'
';
+ if ($uploadedfile) {
+ $result.='Currently submitted: '.$uploadedfile.'';
+ } else {
+ $result.='(Hand in a file you have prepared on your computer)';
+ }
+ $result.='';
}
$result.=''.
''.
@@ -87,6 +95,12 @@ sub end_essayresponse {
$Apache::lonhomework::results{"resource.$part.$id.collaborators"}=$collaborators
if ($collaborators ne $previous_list);
}
+ my $filename= $ENV{'form.HWFILE'.$part.'_'.$id.'.filename'};
+ if ($filename =~ /[^\s]/) {
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedfile"}=$filename;
+ $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}=
+ &Apache::lonnet::userfileupload('HWFILE'.$part.'_'.$id);
+ }
if ( defined $ENV{'form.submitted'}) {
my $response = $ENV{'form.HWVAL'.$id};
if ( $response =~ /[^\s]/) {
|