--- loncom/homework/radiobuttonresponse.pm 2004/10/07 20:28:30 1.95 +++ loncom/homework/radiobuttonresponse.pm 2004/10/21 03:34:06 1.96 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.95 2004/10/07 20:28:30 albertel Exp $ +# $Id: radiobuttonresponse.pm,v 1.96 2004/10/21 03:34:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,12 +118,17 @@ sub storesurvey { my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1']}; &Apache::lonxml::debug("Here I am!:$response:"); if ( $response !~ /[0-9]+/) { return ''; } + my $part = $Apache::inputtags::part; my $id = $Apache::inputtags::response['-1']; my @whichfoils=@{ $Apache::response::foilgroup{'names'} }; my %responsehash; $responsehash{$whichfoils[$response]}=$response; - $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=&Apache::lonnet::hash2str(%responsehash); - $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED'; + my $responsestr=&Apache::lonnet::hash2str(%responsehash); + $Apache::lonhomework::results{"resource.$part.$id.submission"}= + $responsestr; + my %previous=&Apache::response::check_for_previous($responsestr,$part,$id); + my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED'; + &Apache::response::handle_previous(\%previous,$ad); &Apache::lonxml::debug("submitted a $response
\n"); return ''; }