--- loncom/homework/optionresponse.pm 2025/01/27 14:18:38 1.203 +++ loncom/homework/optionresponse.pm 2025/02/21 20:55:17 1.204 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.203 2025/01/27 14:18:38 raeburn Exp $ +# $Id: optionresponse.pm,v 1.204 2025/02/21 20:55:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -736,12 +736,13 @@ sub displayfoils { &mt('Select all that are [_1].','<b>'.$checkboxopt.'</b>'); } foreach $name (@whichopt) { + if ($target eq 'web') { + $result.= '<div class="LC_optionfoil">'; + } my $text=$Apache::response::foilgroup{$name.'.text'}; if ($text!~/^\s*$/) { if ($target eq 'tex') { $break='\vskip 0 mm '; - } elsif ($target eq 'web') { - $break='<br />'; } } my $lastopt=$lastresponse{$name}; @@ -881,6 +882,9 @@ sub displayfoils { } $displayoptionintex=0; } + if ($target eq 'web') { + $result.= '</div>'; + } } } @@ -931,21 +935,23 @@ sub webbubbles { my @alphabet=@$ralphabet; my $result=''; my $number_of_bubbles = $#opt + 1; - $result.= '<table border="1"><tr>'; + $result.= '<fieldset class="LC_webbubbles">'. + '<legend class="LC_visually_hidden">'.&mt('Choose one').'</legend>'. + '<ul class="LC_webbubbles">'; for (my $ind=0;$ind<$number_of_bubbles;$ind++) { my $checked=''; if ($lastopt eq $opt[$ind]) { $checked=' checked="on" '; } - $result.='<td><input type="radio" name="HWVAL_'. + $result.='<li><label><input type="radio" name="HWVAL_'. $Apache::inputtags::response['-1'].':'.$temp. '" value="'.$opt[$ind].'" '.$checked.' />'; if ($alphabet[$ind]) { $result.=$alphabet[$ind].': '; } - $result.=$opt[$ind].'</td>'; + $result.=$opt[$ind].'</label></li>'; } - $result.='</tr></table>'; + $result.='</ul></fieldset>'; return $result; }