--- loncom/homework/essayresponse.pm	2006/05/30 12:45:36	1.72
+++ loncom/homework/essayresponse.pm	2006/09/21 21:23:19	1.74
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.72 2006/05/30 12:45:36 www Exp $
+# $Id: essayresponse.pm,v 1.74 2006/09/21 21:23:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -75,6 +75,32 @@ sub start_essayresponse {
 	$result.=&Apache::inputtags::file_selector($part,$id,
 						   $uploadedfiletypes,'both');
         $result.='</table>';
+    } elsif ($target eq 'web' &&
+	     $Apache::inputtags::status[-1] ne 'CAN_ANSWER') {
+	my $part= $Apache::inputtags::part;
+	my @msgs;
+	if ($Apache::lonhomework::history{"resource.$part.$id.collaborators"} =~ /\S/) {
+	    my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
+	    $result .= '<td>'.&mt('Collaborated with [_1]',$coll).'</td>';
+	}
+
+	my $file_submission = 
+	    &Apache::inputtags::show_past_file_submission($part,$id);
+	if ($file_submission) {
+	    $result .= '<td>'.$file_submission.'</td>';
+	}
+
+	my $port_submission = 
+	    &Apache::inputtags::show_past_portfile_submission($part,$id);
+	if ($port_submission) {
+	    $result .= '<td>'.$port_submission.'</td>';
+	}
+
+	if ($result ne '') {
+	    $result = 
+		'<table class="LC_pastsubmission"><tr>'.$result.
+		'</tr></table>';
+	}
     }
     return $result;
 }
@@ -168,7 +194,7 @@ sub file_submission {
 	
 	my @submitted_files = ($files);
 	if ( $which eq 'portfiles' ) {
-	    @submitted_files = split(/,/,$files);
+	    @submitted_files = split(/\s*,\s*/,$files);
 	}
 
 	my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");