--- loncom/homework/radiobuttonresponse.pm 2006/12/19 11:05:21 1.110
+++ loncom/homework/radiobuttonresponse.pm 2007/04/17 23:25:09 1.114
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# mutliple choice style responses
#
-# $Id: radiobuttonresponse.pm,v 1.110 2006/12/19 11:05:21 foxr Exp $
+# $Id: radiobuttonresponse.pm,v 1.114 2007/04/17 23:25:09 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -206,7 +206,13 @@ sub end_foilgroup {
('true','false'));
}
}
+ $Apache::lonxml::post_evaluate=0;
}
+ if ($target eq 'web') {
+ &Apache::response::setup_prior_tries_hash(\&format_prior_answer,
+ [\%Apache::response::foilgroup]);
+ }
+
&Apache::response::poprandomnumber();
&Apache::lonxml::increment_counter();
return $result;
@@ -230,6 +236,16 @@ sub getfoilcounts {
return ($truecnt,$falsecnt);
}
+sub format_prior_answer {
+ my ($mode,$answer,$other_data) = @_;
+ my $foil_data = $other_data->[0];
+ my %response = &Apache::lonnet::str2hash($answer);
+ my ($name) = keys(%response);
+ return ''.
+ $foil_data->{$name.'.text'}.'';
+
+}
+
sub displayallfoils {
my ($direction, $target)=@_;
my $result;
@@ -289,7 +305,11 @@ sub displayallfoils {
$i++;
} else {
$result .= '