--- loncom/homework/essayresponse.pm	2007/08/10 20:09:30	1.83
+++ loncom/homework/essayresponse.pm	2007/10/08 09:22:50	1.85
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.83 2007/08/10 20:09:30 albertel Exp $
+# $Id: essayresponse.pm,v 1.85 2007/10/08 09:22:50 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,7 +184,11 @@ sub end_essayresponse {
 
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||
 	$target eq 'tex' || $target eq 'analyze') {
-	&Apache::lonxml::increment_counter($increment);
+	&Apache::lonxml::increment_counter($increment, $part);
+
+	if ($target eq 'analyze') {
+	    &Apache::lonhomework::set_bubble_lines();
+	}
     }
     &Apache::response::end_response;
 
@@ -246,7 +250,7 @@ sub file_submission {
 	    $uploadedfiletypes=','.$uploadedfiletypes.',';
 	    foreach my $file (@submitted_files) {
 		my ($extension)=($file=~/\.(\w+)$/);
-		unless ($uploadedfiletypes=~/\,$extension\,/i) {
+		unless ($uploadedfiletypes=~/\,\s*\Q$extension\E\s*\,/i) {
 		    $$award='INVALID_FILETYPE';
 		}
 	    }