--- loncom/homework/caparesponse/caparesponse.pm 2007/03/01 02:31:29 1.209 +++ loncom/homework/caparesponse/caparesponse.pm 2007/04/16 23:25:12 1.211 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.209 2007/03/01 02:31:29 albertel Exp $ +# $Id: caparesponse.pm,v 1.211 2007/04/16 23:25:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -800,8 +800,9 @@ sub setup_prior_tries_hash { my $key = "$i:resource.$part.$id.submission"; next if (!exists($Apache::lonhomework::history{"$key"})); $Apache::inputtags::submission_display{$key} = - '
'.&HTML::Entities::encode($Apache::lonhomework::history{$key},
-					  '"<>&').'
'; + ''. + &HTML::Entities::encode($Apache::lonhomework::history{$key}, + '"<>&').''; } } @@ -1024,6 +1025,19 @@ sub get_sigrange { return ($sig_ubound,$sig_lbound); } +sub setup_prior_tries_hash_string { + my $part=$Apache::inputtags::part; + my $id=$Apache::inputtags::response[-1]; + foreach my $i (1..$Apache::lonhomework::history{'version'}) { + my $key = "$i:resource.$part.$id.submission"; + next if (!exists($Apache::lonhomework::history{"$key"})); + $Apache::inputtags::submission_display{$key} = + ''. + &HTML::Entities::encode($Apache::lonhomework::history{$key}, + '"<>&').''; + } +} + sub start_stringresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; @@ -1201,6 +1215,8 @@ sub end_stringresponse { } } elsif ($target eq 'edit') { $result.=''.&Apache::edit::end_table; + } elsif ($target eq 'web' || $target eq 'tex') { + &setup_prior_tries_hash_string(); } if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {