--- loncom/homework/radiobuttonresponse.pm	2008/11/14 21:27:17	1.137
+++ loncom/homework/radiobuttonresponse.pm	2009/03/18 13:46:26	1.142
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.137 2008/11/14 21:27:17 jms Exp $
+# $Id: radiobuttonresponse.pm,v 1.142 2009/03/18 13:46:26 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -26,126 +26,6 @@
 #
 
 
-=head1 NAME
-
-Apache::radiobuttonresponse
-
-=head1 SYNOPSIS
-
-Handles multiple-choice style responses.
-
-This is part of the LearningOnline Network with CAPA project
-described at http://www.lon-capa.org.
-
-=head1 HANDLER SUBROUTINE
-
-start_radiobuttonresponse()
-
-=head1 OTHER SUBROUTINES
-
-=over
-
-=item *
-
-bubble_line_count()
-
-=item *
-
-end_radiobuttonresponse()
-
-=item *
-
-start_foilgroup()
-
-=item *
-
-storesurvey()
-
-=item *
-
-grade_response()
-
-=item *
-
-end_foilgroup()
-
-=item *
-
-getfoilcounts()
-
-=item *
-
-format_prior_answer()
-
-=item *
-
-displayallfoils()
-
-=item *
-
-&whichfoils($max,$randomize)
-
-Randomizes the list of foils.
-Respects
-  - each foils desire to be randomized
-  - the existance of Concept groups of foils (select 1 foil from each)
-  - and selects a single correct statement from all possilble true statments
-  - and limits it to a toal of $max foils
-
-WARNING: this routine uses the random number generator, it should only
-be called once per target, otherwise it can cause randomness changes in
-homework problems.
-
-Arguments
-  $max - maximum number of foils to select (including the true one)
-         (so a max of 5 is: 1 true, 4 false)
-
-  $randomize - whether to randomize the listing of foils, by default
-               will randomize, only if randomize is 'no' will it not
-
-Returns
-  $answer - location in the array of the correct answer
-  @foils  - array of foil names in to display order
-
-=item *
-
-displayfoils()
-
-=item *
-
-displayallanswers()
-
-=item *
-
-displayanswers()
-
-=item *
-
-start_conceptgroup()
-
-=item *
-
-end_conceptgroup()
-
-=item *
-
-insert_conceptgroup()
-
-=item *
-
-start_foil()
-
-=item *
-
-end_foil()
-
-=item *
-
-insert_foil()
-
-=back
-
-=cut
 
 package Apache::radiobuttonresponse;
 use strict;
@@ -194,14 +74,14 @@ sub start_radiobuttonresponse {
            .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
            .&Apache::edit::deletelist($target,$token)
            .'</span></td>'
-           .'<td>&nbsp'.&Apache::edit::end_row()
+           .'<td>&nbsp;'.&Apache::edit::end_row()
            .&Apache::edit::start_spanning_row();
 	$result.=
 	    &Apache::edit::text_arg('Max Number Of Shown Foils:','max',
-				    $token,'4').
+				    $token,'4').'&nbsp;'x 3 .
 	    &Apache::edit::select_arg('Randomize Foil Order:','randomize',
-				      ['yes','no'],$token).
-	    &Apache::edit::select_arg('Display Direction','direction',
+				      ['yes','no'],$token).'&nbsp;'x 3 .
+	    &Apache::edit::select_arg('Display Direction:','direction',
 				      ['vertical','horizontal'],$token).
 				      &Apache::edit::end_row().
 				      &Apache::edit::start_spanning_row()."\n";
@@ -506,8 +386,8 @@ sub displayallfoils {
                        onchange=\"javascript:setSubmittedPart('$part');\"
                        type=\"radio\"
                        name=\"HWVAL_$Apache::inputtags::response['-1']\"
-                       value=\"$temp\" ";
-		    if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
+                       value=\"$temp\"";
+		    if (defined($lastresponse{$name})) { $result .= ' checked="checked"'; }
 		    $result .= ' />'.$Apache::response::foilgroup{$name.'.text'}.
 			'</label>';
 		}
@@ -735,8 +615,8 @@ sub displayfoils {
 		    "<input type=\"radio\"
                             onchange=\"javascript:setSubmittedPart('$part');\"
                             name=\"HWVAL_$Apache::inputtags::response['-1']\"
-                            value=\"$temp\" ";
-		if (defined($lastresponse{$name})) { $result .= 'checked="on"'; }
+                            value=\"$temp\"";
+		if (defined($lastresponse{$name})) { $result .= ' checked="checked"'; }
 		$result .= ' />'.$Apache::response::foilgroup{$name.'.text'}."</label>";
 	    } else {
 		if ($Apache::lonhomework::type eq 'exam') {
@@ -928,4 +808,87 @@ sub insert_foil {
 }
 1;
 __END__
+
+
+
+=head1 NAME
+
+Apache::radiobuttonresponse
+
+=head1 SYNOPSIS
+
+Handles multiple-choice style responses.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 SUBROUTINES
+
+=over
+
+=item start_radiobuttonresponse()
+
+=item bubble_line_count()
+
+=item end_radiobuttonresponse()
+
+=item start_foilgroup()
+
+=item storesurvey()
+
+=item grade_response()
+
+=item end_foilgroup()
+
+=item getfoilcounts()
+
+=item format_prior_answer()
+
+=item displayallfoils()
+
+=item &whichfoils($max,$randomize)
+
+Randomizes the list of foils.
+Respects
+  - each foils desire to be randomized
+  - the existance of Concept groups of foils (select 1 foil from each)
+  - and selects a single correct statement from all possilble true statments
+  - and limits it to a toal of $max foils
+
+WARNING: this routine uses the random number generator, it should only
+be called once per target, otherwise it can cause randomness changes in
+homework problems.
+
+Arguments
+  $max - maximum number of foils to select (including the true one)
+         (so a max of 5 is: 1 true, 4 false)
+
+  $randomize - whether to randomize the listing of foils, by default
+               will randomize, only if randomize is 'no' will it not
+
+Returns
+  $answer - location in the array of the correct answer
+  @foils  - array of foil names in to display order
+
+=item displayfoils()
+
+=item displayallanswers()
+
+=item displayanswers()
+
+=item start_conceptgroup()
+
+=item end_conceptgroup()
+
+=item insert_conceptgroup()
+
+=item start_foil()
+
+=item end_foil()
+
+=item insert_foil()
+
+=back
+
+=cut