--- loncom/xml/lonxml.pm 2010/02/08 00:35:06 1.505 +++ loncom/xml/lonxml.pm 2010/05/30 02:57:01 1.505.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.505 2010/02/08 00:35:06 raeburn Exp $ +# $Id: lonxml.pm,v 1.505.2.1 2010/05/30 02:57:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2291,24 +2291,20 @@ sub get_tag { =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.'}'; }