--- loncom/homework/caparesponse/caparesponse.pm 2008/06/10 15:22:39 1.226 +++ loncom/homework/caparesponse/caparesponse.pm 2008/09/13 02:46:59 1.227.2.2 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.226 2008/06/10 15:22:39 www Exp $ +# $Id: caparesponse.pm,v 1.227.2.2 2008/09/13 02:46:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -311,8 +311,7 @@ sub start_numericalresponse { if ($unit =~ /\S/) { $result.=" (in $unit) "; } } if (($token->[1] eq 'formularesponse') && - ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') && - (!&Apache::lonxml::get_param_var('samples',$parstack,$safeeval))) { + ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')) { $result.=&edit_formula_button($id,"HWVAL_$id"); } if ( &Apache::response::show_answer() ) { @@ -448,8 +447,12 @@ sub check_submission { } } elsif ($tag eq 'numericalresponse') { $$args_ref{'type'}='float'; + } elsif ($tag eq 'stringresponse') { + if ($$args_ref{'type'} eq '') { + $$args_ref{'type'} = 'ci'; + } } - + &add_in_tag_answer($parstack,$safeeval); if (!%answer) { @@ -1172,7 +1175,9 @@ sub end_stringresponse { my @args = ('type'); my $args_ref = &setup_capa_args($safeeval,$parstack, \@args,$response); - + if ($$args_ref{'type'} eq '') { + $$args_ref{'type'} = 'ci'; + } &add_in_tag_answer($parstack,$safeeval); my (@final_awards,@final_msgs,@names); foreach my $name (keys(%answer)) {