--- loncom/homework/caparesponse/caparesponse.pm 2003/10/15 19:54:45 1.107.2.2 +++ loncom/homework/caparesponse/caparesponse.pm 2003/08/21 17:33:22 1.108 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.107.2.2 2003/10/15 19:54:45 albertel Exp $ +# $Id: caparesponse.pm,v 1.108 2003/08/21 17:33:22 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -169,7 +169,10 @@ sub end_numericalresponse { $safeeval); my $award = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"}; my $status = $Apache::inputtags::status['-1']; - if ( &Apache::response::show_answer() ) { + if ( ($award =~ /^correct/ + && lc($Apache::lonhomework::problemstatus) ne 'no') + || $status eq "SHOW_ANSWER" + || $ENV{'form.texaward'} eq 'SHOW_ANSWER') { my (@formats)=&Apache::lonxml::get_param_var('format',$parstack, $safeeval); my $unit=&Apache::lonxml::get_param_var('unit',$parstack, @@ -231,16 +234,11 @@ sub end_numericalresponse { if ($$tagstack[-1] eq 'numericalresponse') { if ($unit=~/\S/) {$result.=' (in '.$unit.')

';} $result.= ''; - my $previous=$Apache::lonhomework::history{"resource.$Apache::inputtags::part.$id.submission"}; for (my $ind=0;$ind<$number_of_bubbles;$ind++) { - my $checked=''; - if ($previous eq $bubble_values[$ind]) { - $checked=" checked='on' "; - } $result.=''; + '" value="'.$bubble_values[$ind].'">'. + $alphabet[$ind].': '. + $bubble_values[$ind].''; } $result.='
'.$alphabet[$ind].': '. - $bubble_values[$ind].'
'; } elsif ($$tagstack[-1] eq 'formularesponse') { @@ -368,7 +366,7 @@ sub end_numericalresponse { if ($target eq 'answer') { if ($ENV{'form.answer_output_mode'} eq 'tex') { $result.=&Apache::response::answer_part($$tagstack[-1], - "\\textbf{$string}"); + "$string"); } else { $result.=&Apache::response::answer_part($$tagstack[-1], "$string");