--- loncom/homework/optionresponse.pm 2003/04/02 18:07:10 1.72 +++ loncom/homework/optionresponse.pm 2003/04/07 22:28:08 1.74 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.72 2003/04/02 18:07:10 sakharuk Exp $ +# $Id: optionresponse.pm,v 1.74 2003/04/07 22:28:08 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,7 +185,10 @@ sub end_foilgroup { my $wrong=0; my $ignored=0; foreach $name (@whichopt) { - my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1'].":$temp"}; + my $response=&Apache::response::getresponse($temp); + if ($ENV{'form.submitted'} eq 'scantron') { + $response = $opt[$response]; + } $responsehash{$name}=$response; if ( $response =~ /[^\s]/) { my $value=$Apache::response::foilgroup{$name.'.value'}; @@ -227,10 +230,13 @@ sub end_foilgroup { &Apache::response::handle_previous(\%previous,$ad); } } + &Apache::lonxml::increment_counter(&getfoilcounts($max)); } elsif ($target eq 'edit') { $result.=&Apache::edit::end_table(); - } - if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {$result .= '\end{enumerate}';} + } + if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') { + $result .= '\end{enumerate}'; + } return $result; } @@ -393,7 +399,7 @@ sub displayfoils { } $result.=$break.$text."\n"; if ($Apache::lonhomework::type eq 'exam') { - $result.=&webbubbles(\@opt,\@alphabet); + $result.=&webbubbles(\@opt,\@alphabet,$temp); } $temp++; } else { @@ -468,14 +474,14 @@ sub optionlist_correction { sub webbubbles { - my ($ropt,$ralphabet)=@_; + my ($ropt,$ralphabet,$temp)=@_; my @opt=@$ropt; my @alphabet=@$ralphabet; my $result=''; my $number_of_bubbles = $#opt + 1; $result.= ''; for (my $ind=0;$ind<$number_of_bubbles;$ind++) { - $result.=''; } $result.='
'.$alphabet[$ind].': '.$opt[$ind].'
'; @@ -505,7 +511,6 @@ sub bubbles { } } - &Apache::lonxml::increment_counter(); return $result; }