--- loncom/homework/radiobuttonresponse.pm 2012/01/20 11:41:31 1.153.6.1 +++ loncom/homework/radiobuttonresponse.pm 2012/01/21 20:54:57 1.153.6.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.153.6.1 2012/01/20 11:41:31 foxr Exp $ +# $Id: radiobuttonresponse.pm,v 1.153.6.2 2012/01/21 20:54:57 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -769,6 +769,39 @@ sub whichfoils { return ( $answer, @whichfalse ); } ## +# Generate the HTML for a single html foil. +# @param $part - The part for which the response is being generated. +# @param $fieldname - The basename of the radiobutton field +# @param $name - The foilname. +# @param $last_responses - Reference to a hash that holds the most recent +# responses. +# @param $value - radiobutton value. +# +# @return text +# @retval The generated html. +# +sub html_radiobutton { + my ($part, $fieldname, $name, $last_responses, $value) = @_; + + my $result=''; + + return $result; + +} + +## # Display foils in html rendition: # # @param $whichfoils - Set of foils to display. @@ -863,48 +896,6 @@ sub displayfoils { $result = &display_foils_html( $whichfoils, $target, $direction, $part, $solved, 1); -# if ( $direction eq 'horizontal' ) { -# if ( $target ne 'tex' ) { -# $result .= ''; -# } -# } -# foreach my $name ( @{$whichfoils} ) { -# if ( $direction eq 'horizontal' ) { -# if ( $target ne 'tex' ) { $result .= ''; } -# } -# } -# if ( $direction eq 'horizontal' ) { -# if ( $target ne 'tex' ) { -# $result .= '
'; } -# } -# if ( $target ne 'tex' ) { -# $result .= "
"; -# } -# else { -# $result .= '\item \vskip -2 mm '; -# } -# if ( $Apache::response::foilgroup{ $name . '.value' } eq 'true' ) { -# if ( $target ne 'tex' ) { -# $result .= &mt('Correct:') . ''; -# } -# else { -# $result .= &mt('Correct:') . ' \textbf{'; -# } -# } -# else { -# $result .= &mt('Incorrect:'); -# } -# if ( $target eq 'web' ) { $result .= ""; } -# if ( $Apache::response::foilgroup{ $name . '.value' } eq 'true' ) { -# if ( $target ne 'tex' ) { $result .= ''; } -# else { $result .= '}'; } -# } -# if ( $direction eq 'horizontal' ) { -# if ( $target ne 'tex' ) { $result .= '
'; -# } -# } } else { my @alphabet = ( 'A' .. 'Z' ); @@ -970,27 +961,26 @@ sub displayfoils { $result .= '\item[\textbf{' . $Apache::lonxml::counter . '}.]'; } } + my $item_pretext; + my $item_posttext; + if ( $target ne 'tex' ) { + if ( $direction eq 'horizontal' ) { + $item_pretext = ''; + $item_posttext = ''; + } + else { + $item_pretext = '
'; + } + } foreach my $name ( @{$whichfoils} ) { + if ( $target ne 'tex' ) { - if ( $direction eq 'horizontal' ) { - $result .= ""; - } - else { - $result .= "
"; - } - } - if ( $target ne 'tex' ) { - $result .= '