[LON-CAPA-cvs] cvs: loncom /homework radiobuttonresponse.pm

onken onken@source.lon-capa.org
Sat, 23 May 2009 05:04:58 -0000


onken		Sat May 23 05:04:58 2009 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm 
  Log:
  - do not print pdf-forms when radiobutton problem is not answerable
  
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.142 loncom/homework/radiobuttonresponse.pm:1.143
--- loncom/homework/radiobuttonresponse.pm:1.142	Wed Mar 18 13:46:26 2009
+++ loncom/homework/radiobuttonresponse.pm	Sat May 23 05:04:58 2009
@@ -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 @@
 	} 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 @@
     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 @@
 		    $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 @@
 		    }
 		}
 		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 @@
 		    $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.