--- loncom/homework/radiobuttonresponse.pm	2009/03/18 13:46:26	1.142
+++ loncom/homework/radiobuttonresponse.pm	2009/05/23 05:04:58	1.143
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.142 2009/03/18 13:46:26 bisitz Exp $
+# $Id: radiobuttonresponse.pm,v 1.143 2009/05/23 05:04:58 onken Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,7 +104,7 @@ sub start_radiobuttonresponse {
 	} else {
 	    $result .= ' \renewcommand{\labelenumi}{\Alph{enumi}.}';
 	}
-        if($env{'form.pdfFormFields'} eq 'yes') {
+        if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
             $result .= &Apache::lonxml::print_pdf_hiddenfield('meta', $env{'user.name'}, $env{'user.domain'});
             $result .= "\n\\\\\n\\\\\n";
         } else {
@@ -122,7 +122,7 @@ sub end_radiobuttonresponse {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;
     if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
-    if ($target eq 'tex' and $env{'form.pdfFormFields'} ne 'yes') { 
+    if ($target eq 'tex' and ($env{'form.pdfFormFields'} ne 'yes' or $Apache::inputtags::status[-1] ne 'CAN_ANSWER')) {
         $result .= '\end{enumerate}'; 
     }
     &Apache::response::end_response;
@@ -358,7 +358,7 @@ sub displayallfoils {
 		    $result.="<td>";
 		} else {
 		    if ($target eq 'tex') {
-		        if($env{'form.pdfFormFields'} eq 'yes') {
+		        if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
                             my $fieldname = $env{'request.symb'}.
                                            '&part_'. $Apache::inputtags::part.
                                            '&radiobuttonresponse'.
@@ -376,7 +376,7 @@ sub displayallfoils {
 		    }
 		}
 		if ($target eq 'tex') {
-		    if($env{'form.pdfFormFields'} ne 'yes') {
+		    if($env{'form.pdfFormFields'} ne 'yes' or $Apache::inputtags::status[-1] ne 'CAN_ANSWER') {
                         $result .= '$\bigcirc$'.$Apache::response::foilgroup{$name.'.text'}.'\\\\';  #' stupid emacs
                     }
 		    $i++;
@@ -630,7 +630,7 @@ sub displayfoils {
 		    $i++;
 		    $bubble_number++;
 		} else {
-		      if($env{'form.pdfFormFields'} eq 'yes') {
+		      if($env{'form.pdfFormFields'} eq 'yes' && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
 
                          my $fieldname = $env{'request.symb'}.
                                          '&part_'. $Apache::inputtags::part.