--- loncom/homework/imageresponse.pm 2007/10/08 09:22:50 1.89 +++ loncom/homework/imageresponse.pm 2007/10/15 20:20:49 1.91 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # image click response style # -# $Id: imageresponse.pm,v 1.89 2007/10/08 09:22:50 foxr Exp $ +# $Id: imageresponse.pm,v 1.91 2007/10/15 20:20:49 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -79,7 +79,8 @@ sub start_imageresponse { sub end_imageresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; - my $part_id = $Apache::inputtags::part; + my $part_id = $Apache::inputtags::part; + my $response_id = $Apache::inputtags::response[-1]; pop(@Apache::lonxml::namespace); &Apache::lonxml::deregister('Apache::imageresponse',('foilgroup','foil','text','image','rectangle','conceptgroup')); @@ -97,7 +98,7 @@ sub end_imageresponse { if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { &Apache::lonxml::increment_counter(&Apache::response::repetition(), - $part_id); + "$part_id.$response_id"); if ($target eq 'analyze') { &Apache::lonhomework::set_bubble_lines(); } @@ -236,7 +237,8 @@ sub displayfoils { if ($target eq 'tex') {$result.="\\vskip 0 mm \n";} else {$result.="
\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); @@ -301,7 +303,8 @@ sub display_answers { 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);