--- loncom/homework/response.pm	2005/06/29 19:20:10	1.122
+++ loncom/homework/response.pm	2005/08/17 16:52:37	1.124
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.122 2005/06/29 19:20:10 albertel Exp $
+# $Id: response.pm,v 1.124 2005/08/17 16:52:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -71,14 +71,14 @@ sub start_hintresponse {
     my ($parstack,$safeeval)=@_;
     my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);
     if ($id eq '') { $id = $Apache::lonxml::curdepth; }
-    push (@Apache::inputtags::response,$id);
-    push (@Apache::inputtags::responselist,$id);
+    push (@Apache::inputtags::hint,$id);
+    push (@Apache::inputtags::hintlist,$id);
     push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]);
     return $id;
 }
 
 sub end_hintresponse {
-    pop @Apache::inputtags::response;
+    pop @Apache::inputtags::hint;
     if (defined($Apache::inputtags::paramstack[-1])) {
 	%Apache::inputtags::params=
 	    @{ pop(@Apache::inputtags::paramstack) };
@@ -505,7 +505,15 @@ sub answer_part {
     my ($type,$answer) = @_;
     my $result;
     if ($env{'form.answer_output_mode'} eq 'tex') {
-	$result = ' \verb|'.$answer.'|\\\\ \hline ';
+	my $to_use='|';
+	foreach my $value (32..126) {
+	    my $char=pack('c',$value);
+	    if ($answer !~ /\Q$char\E/) {
+		$to_use=$char;
+		last;
+	    }
+	}
+	$result = '\verb'.$to_use.$answer.$to_use.'\\\\ \hline ';
     } else {
 	$result = '<td>'.$answer.'</td>';
     }