--- loncom/homework/optionresponse.pm 2004/07/29 19:40:23 1.116 +++ loncom/homework/optionresponse.pm 2004/09/29 05:47:33 1.120 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.116 2004/07/29 19:40:23 albertel Exp $ +# $Id: optionresponse.pm,v 1.120 2004/09/29 05:47:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -192,7 +192,7 @@ sub end_foilgroup { my $ignored=0; foreach $name (@whichopt) { my $response=&Apache::response::getresponse($temp); - if ($ENV{'form.submitted'} eq 'scantron') { + if ($ENV{'form.submitted'} eq 'scantron' && $response=~/\S/) { $response = $opt[$response]; } if ( $response =~ /[^\s]/) { @@ -238,7 +238,11 @@ sub end_foilgroup { } else { my $ad; if ($wrong==0 && $right==0) { - #nothing submitted + #nothing submitted only assign a score if we + #need to override a previous grade + if (defined($Apache::lonhomework::history{"resource.$part.$id.awarddetail"})) { + $ad='ASSIGNED_SCORE'; + } } else { $ad='ASSIGNED_SCORE'; } @@ -491,8 +495,8 @@ sub webbubbles { sub bubbles { - my ($ralphabit,$ropt) = @_; - my @alphabet = @$ralphabit; + my ($ralphabet,$ropt,$response) = @_; + my @alphabet = @$ralphabet; my @opt = @$ropt; my ($result,$head,$line) =('','',''); my $number_of_bubbles = $#opt + 1; @@ -508,6 +512,7 @@ sub bubbles { for (my $ind=0;$ind<=$number_of_bubbles;$ind++) { my $leftmargin; $opt[$ind]=&Apache::lonxml::latex_special_symbols($opt[$ind]); + if ($response eq 'rankresponse') {$opt[$ind]='Rank '.$opt[$ind];} if ($ind==0) {$leftmargin=6;} else {$leftmargin=10;} $current_length += (length($opt[$ind])+length($alphabet[$ind])+4)*2; if ($current_length<($textwidth-$leftmargin) and $ind!=$number_of_bubbles) { @@ -649,12 +654,16 @@ sub end_foil { sub start_drawoptionlist { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; - return $token->[4]; + if ($target ne 'meta') { + return $token->[4]; + } } sub end_drawoptionlist { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; - return $token->[2]; + if ($target ne 'meta') { + return $token->[2]; + } } sub insert_foil {