--- loncom/homework/response.pm 2001/08/22 19:21:36 1.47
+++ loncom/homework/response.pm 2001/09/14 20:15:35 1.48
@@ -44,7 +44,13 @@ sub end_hintresponse {
# used by response to set the non-safe space random number generator to something
# that is stable and unique based on the part number and response number
sub setrandomnumber {
- my $rndseed=&Apache::lonnet::rndseed();
+ my $rndseed;
+ if ($ENV{'request.state'} eq "construct") {
+ $rndseed=$ENV{'form.rndseed'};
+ if (!$rndseed) { $rndseed=time; }
+ } else {
+ $rndseed=&Apache::lonnet::rndseed();
+ }
&Apache::lonxml::debug("randseed $rndseed");
# $rndseed=unpack("%32i",$rndseed);
$rndseed=$rndseed
@@ -336,6 +342,41 @@ sub setup_params {
}
}
+sub answer_header {
+ my ($type) = @_;
+ my $result;
+ if ($type eq 'optionresponse') {
+ $result = '
Answer for Part:'.
+ $Apache::inputtags::part. ' |
---|
'."\n";
+ } else {
+ $result = 'Answer for Part:'.$Apache::inputtags::part.
+ ' | '."\n";
+ }
+ return $result;
+}
+
+sub answer_part {
+ my ($type,$answer) = @_;
+ my $result;
+ if ($type eq 'optionresponse') {
+ $result = ''.$answer.' | ';
+ } else {
+ $result = ''.$answer.' | ';
+ }
+ return $result;
+}
+
+sub answer_footer {
+ my ($type) = @_;
+ my $result;
+ if ($type eq 'optionresponse') {
+ $result = '
';
+ } else {
+ $result = '
';
+ }
+ return $result;
+}
+
1;
__END__