--- loncom/homework/imageresponse.pm	2003/10/27 19:27:09	1.37
+++ loncom/homework/imageresponse.pm	2003/10/30 20:52:54	1.39
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.37 2003/10/27 19:27:09 albertel Exp $
+# $Id: imageresponse.pm,v 1.39 2003/10/30 20:52:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -175,7 +175,8 @@ sub end_foilgroup {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';
     my @whichopt;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') {
 	my ($count,$max) = &getfoilcounts($parstack,$safeeval);
 	if ($count>$max) { $count=$max }
 	&Apache::lonxml::debug("Count is $count from $max");
@@ -264,9 +265,7 @@ sub start_text {
 	    &Apache::edit::editfield($token->[1],$descr,'Text',60,2).
 	    &Apache::edit::end_row();
     } elsif ($target eq "modified") {
-	my $descr=&Apache::lonxml::get_all_text('/text',$parser);
-	$result=$token->[4].&Apache::edit::modifiedfield($token);
-	&Apache::lonxml::debug($result);
+	$result=$token->[4].&Apache::edit::modifiedfield('/text',$parser);
     }
     return $result;
 }
@@ -304,9 +303,7 @@ sub start_image {
 	$result.=&Apache::edit::search(undef,'textnode').
 	    &Apache::edit::end_row();
     } elsif ($target eq "modified") {
-	my $bgimg=&Apache::lonxml::get_all_text('/image',$parser);
-	$result=$token->[4].&Apache::edit::modifiedfield($token);
-	&Apache::lonxml::debug($result);
+	$result=$token->[4].&Apache::edit::modifiedfield('/image',$parser);
     }
     return $result;
 }
@@ -443,7 +440,8 @@ sub end_image {
 sub start_rectangle {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') { 
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') { 
 	&Apache::lonxml::startredirection; 
     } elsif ($target eq 'edit') {
 	my $coords=&Apache::lonxml::get_all_text('/rectangle',$parser);
@@ -452,9 +450,7 @@ sub start_rectangle {
 	    &Apache::edit::entercoordpair(undef,'textnode').
 	    &Apache::edit::end_row();
     } elsif ($target eq "modified") {
-	my $coords=&Apache::lonxml::get_all_text('/rectangle',$parser);
-	$result=$token->[4].&Apache::edit::modifiedfield($token);
-	&Apache::lonxml::debug($result);
+	$result=$token->[4].&Apache::edit::modifiedfield('/rectangle',$parser);
     }
     return $result;
 }
@@ -479,7 +475,8 @@ sub grade_rectangle {
 sub end_rectangle {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
-    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex') {
+    if ($target eq 'web' || $target eq 'grade' || $target eq 'tex' ||
+	$target eq 'analyze') {
 	my $name = $Apache::imageresponse::curname;
 	my $area = &Apache::lonxml::endredirection;
 	&Apache::lonxml::debug("out is $area for $name");