--- loncom/homework/externalresponse.pm 2005/10/18 15:33:55 1.6 +++ loncom/homework/externalresponse.pm 2007/09/11 19:07:01 1.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # external style responses # -# $Id: externalresponse.pm,v 1.6 2005/10/18 15:33:55 albertel Exp $ +# $Id: externalresponse.pm,v 1.8 2007/09/11 19:07:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -79,6 +79,7 @@ sub end_externalresponse { } else { &Apache::lonxml::register('Apache::loncapagrade', ('loncapagrade')); + @Apache::scripttag::parser_env = @_; my $result=&Apache::scripttag::xmlparse($res->{_content}); &Apache::lonxml::debug("Got a result of :$result:"); } @@ -97,6 +98,10 @@ sub end_externalresponse { } } } + if ($target eq 'web') { + &Apache::response::setup_prior_tries_hash(\&format_prior_response); + } + if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') { &Apache::lonxml::increment_counter($increment); @@ -105,6 +110,12 @@ sub end_externalresponse { return $result; } +sub format_prior_response { + my ($mode,$answer) =@_; + return ''. + &HTML::Entities::encode($answer,'"<>&').''; +} + 1; __END__