--- loncom/homework/optionresponse.pm 2025/01/26 17:49:32 1.202 +++ 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.202 2025/01/26 17:49:32 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].',''.$checkboxopt.''); } foreach $name (@whichopt) { + if ($target eq 'web') { + $result.= '
'; + } my $text=$Apache::response::foilgroup{$name.'.text'}; if ($text!~/^\s*$/) { if ($target eq 'tex') { $break='\vskip 0 mm '; - } elsif ($target eq 'web') { - $break='
'; } } my $lastopt=$lastresponse{$name}; @@ -798,15 +799,9 @@ sub displayfoils { $fieldname.'\'].checked) { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$esccheckboxopt.'\'; } else { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$escaltopt.'\'; };javascript:setSubmittedPart(\''.$part.'\');"'.($defopt eq $checkboxopt?' checked="checked"':'')." />\n"; } else { # classic selection list - my $labeltext; - if ($Apache::lonhomework::type ne 'exam') { - $labeltext = $text; - $labeltext =~s||$optionlist|; - } - $labeltext = &HTML::Entities::encode($labeltext,'\'"&<>'); - $optionlist='\n"; } } else { @@ -826,7 +821,7 @@ sub displayfoils { $result.=$break.$text."\n"; if ($Apache::lonhomework::type eq 'exam') { $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt); - } elsif ($checkboxopt) { + } else { $result.= ''; } $temp++; @@ -887,6 +882,9 @@ sub displayfoils { } $displayoptionintex=0; } + if ($target eq 'web') { + $result.= '
'; + } } } @@ -937,21 +935,23 @@ sub webbubbles { my @alphabet=@$ralphabet; my $result=''; my $number_of_bubbles = $#opt + 1; - $result.= ''; + $result.= '
'. + ''.&mt('Choose one').''. + '
'; + $result.=$opt[$ind].''; } - $result.='
'; if ($alphabet[$ind]) { $result.=$alphabet[$ind].': '; } - $result.=$opt[$ind].'
'; + $result.=''; return $result; }