--- loncom/homework/optionresponse.pm 2003/04/02 18:40:37 1.73 +++ 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.73 2003/04/02 18:40:37 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; } @@ -505,7 +511,6 @@ sub bubbles { } } - &Apache::lonxml::increment_counter(); return $result; }