[LON-CAPA-cvs] cvs: loncom /homework imageresponse.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Mon, 15 Oct 2007 20:20:50 -0000


albertel		Mon Oct 15 16:20:50 2007 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  - BUG#5478 - need to cleanup images in answer mode too
  
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.90 loncom/homework/imageresponse.pm:1.91
--- loncom/homework/imageresponse.pm:1.90	Mon Oct 15 05:47:29 2007
+++ loncom/homework/imageresponse.pm	Mon Oct 15 16:20:49 2007
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.90 2007/10/15 09:47:29 foxr Exp $
+# $Id: imageresponse.pm,v 1.91 2007/10/15 20:20:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -237,7 +237,8 @@
 	if ($target eq 'tex') {$result.="\\vskip 0 mm \n";} else {$result.="<br />\n";}
 	my $image=$Apache::response::foilgroup{"$name.image"};
 	&Apache::lonxml::debug("image is $image");
-	if ( $target eq 'web' && $image !~ /^http:/ ) {
+	if ( ($target eq 'web' || $target eq 'answer') 
+	     && $image !~ /^http:/ ) {
 	    $image=&clean_up_image($image);
 	}
 	push(@images,$image);
@@ -302,7 +303,8 @@
     foreach my $name (@$whichopt) {
 	my $image=$Apache::response::foilgroup{"$name.image"};
 	&Apache::lonxml::debug("image is $image");
-	if ( $target eq 'web' && $image !~ /^http:/ ) {
+	if ( ($target eq 'web' || $target eq 'answer')
+	     && $image !~ /^http:/ ) {
 	    $image = &clean_up_image($image);
 	} 
 	my $token=&prep_image($image,'answeronly',$name);