--- loncom/homework/externalresponse.pm 2008/02/01 22:05:45 1.13 +++ loncom/homework/externalresponse.pm 2010/12/20 15:54:03 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # external style responses # -# $Id: externalresponse.pm,v 1.13 2008/02/01 22:05:45 raeburn Exp $ +# $Id: externalresponse.pm,v 1.16 2010/12/20 15:54:03 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,6 +26,8 @@ # http://www.lon-capa.org/ # + + package Apache::externalresponse; use strict; use HTTP::Request::Common; @@ -36,10 +38,16 @@ BEGIN { &Apache::lonxml::register('Apache::externalresponse',('externalresponse')); } -#FIXME -# send of response params and their current values (form good enough? -# what parameters to send?) -# Need to get returned message displayed +=pod + +=head1 FIXME (start_externalresponse) + +send of response params and their current values (form good enough? what parameters to send?) +Need to get returned message displayed + +=cut + + sub start_externalresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; @@ -105,6 +113,7 @@ sub end_externalresponse { $Apache::lonhomework::results{"resource.$part.$id.$key"}= $Apache::loncapagrade::results{$key}; } + $Apache::externalresponse::message=$Apache::loncapagrade::results{'message'}; &Apache::response::handle_previous(\%previous, $Apache::loncapagrade::results{'awarddetail'}); &Apache::lonxml::debug("response of"); @@ -118,6 +127,10 @@ sub end_externalresponse { } if ($target eq 'web') { &Apache::response::setup_prior_tries_hash(\&format_prior_response); + if ($Apache::externalresponse::message) { + $result.='
'.$Apache::externalresponse::message; + } + $Apache::externalresponse::message=''; } if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || @@ -143,3 +156,29 @@ sub format_prior_response { __END__ +=pod + +=head1 NAME + +Apache::externalresponse.pm + +=head1 SYNOPSIS + +Handler to evaluate externally graded responses. + +This is part of the LearningOnline Network with CAPA project +described at http://www.lon-capa.org. + +=head1 SUBROUTINES + +=over + +=item start_externalresponse() + +=item end_externalresponse() + +=item format_prior_response() + +=back + +=cut