--- loncom/homework/essayresponse.pm 2004/10/26 21:27:10 1.43
+++ loncom/homework/essayresponse.pm 2004/11/13 21:07:20 1.47
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.43 2004/10/26 21:27:10 banghart Exp $
+# $Id: essayresponse.pm,v 1.47 2004/11/13 21:07:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,9 +51,9 @@ sub start_essayresponse {
my $uploadedfile= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"},'<>&"');
$result='
';
$result.=''.
- ' '.
+ ' '.
&mt('Submit entries below as answer to receive credit').' '.
- ' '.
+ ' '.
&mt('Save entries below as a draft answer (not submitting them for credit yet)').
' |
';
if ($ncol > 0) {
@@ -75,7 +75,7 @@ sub start_essayresponse {
'
'.
''.
'
';
- if ($portfile=~/[^\s]/){
+ if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){
$result.="Portfolio files previously selected: ".$Apache::lonhomework::history{"resource.$part.$id.portfiles"}."
";
}
@@ -142,6 +142,14 @@ sub end_essayresponse {
if ($portfiles =~ /[^\s]/) {
$Apache::lonhomework::results{"resource.$part.$id.portfiles"}=$portfiles;
$Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}=$portfiles;
+ my @submitted_files = split /,/,$portfiles;
+ my ($dsymb,$crsid,$domain,$name)=
+ &Apache::lonxml::whichuser();
+ foreach (@submitted_files) {
+ my $file = $_;
+ &Apache::lonnet::put('file_permissions',
+ { $dsymb.$crsid => $file },$domain,$name);
+ }
$uploadedflag=1;
}
$Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;