[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

onken onken@source.lon-capa.org
Mon, 03 May 2010 14:43:07 -0000


onken		Mon May  3 14:43:07 2010 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  changes sub print_pdf_radiobutton - only print a single PDF-form-radiobutton instead a whole tabularx
  
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.507 loncom/xml/lonxml.pm:1.508
--- loncom/xml/lonxml.pm:1.507	Sun Mar 21 18:32:02 2010
+++ loncom/xml/lonxml.pm	Mon May  3 14:43:07 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.507 2010/03/21 18:32:02 www Exp $
+# $Id: lonxml.pm,v 1.508 2010/05/03 14:43:07 onken Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2188,24 +2188,20 @@
 
 =pod
 
-=item &print_pdf_radiobutton(fieldname, value,  text)
+=item &print_pdf_radiobutton(fieldname, value)
 
-Returns a latexline to generate a PDF-Form-Radiobutton with Text.
+Returns a latexline to generate a PDF-Form-Radiobutton.
+Note: Radiobuttons with equal names are automaticly grouped 
+      in a selection-group.
 
-$fieldname: PDF internalname of the radiobutton
-$value:     Value of radiobutton (read when dumping the PDF data)
-$text:      Text on the rightside of the radiobutton
+$fieldname: PDF internalname of the radiobutton(group)
+$value:     Value of radiobutton
 
 =cut
 sub print_pdf_radiobutton {
-    my $result = '';
-    my ($fieldName, $value, $text) = @_;
-    $result .= '\begin{tabularx}{\textwidth}{p{0cm}X}'."\n";
-    $result .= '\radioButton[\symbolchoice{circle}]{'. 
-               $fieldName.'}{10bp}{10bp}{'.$value.'}&'.$text."\n";
-    $result .= '\end{tabularx}' . "\n";
-    $result .= '\hspace{2mm}' . "\n";
-    return $result;
+    my ($fieldname, $value) = @_;
+    return '\radioButton[\symbolchoice{circle}]{'
+           .$fieldname.'}{10bp}{10bp}{'.$value.'}';
 }