--- loncom/homework/caparesponse/caparesponse.pm 2008/09/08 16:08:37 1.230 +++ loncom/homework/caparesponse/caparesponse.pm 2008/09/20 00:25:39 1.234 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.230 2008/09/08 16:08:37 riegler Exp $ +# $Id: caparesponse.pm,v 1.234 2008/09/20 00:25:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -310,9 +310,6 @@ sub start_numericalresponse { $safeeval); if ($unit =~ /\S/) { $result.=" (in $unit) "; } } - if (($token->[1] eq 'formularesponse') && - ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')) { - } if ( &Apache::response::show_answer() ) { &set_answertext($tag_internal_answer_name,$target,$token,$tagstack, $parstack,$parser,$safeeval,-1); @@ -430,8 +427,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) { @@ -606,7 +607,8 @@ sub end_numericalresponse { } } if (($target eq 'web') && ($tag eq 'formularesponse') - && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER')&& (&Apache::lonxml::get_param('turnoneditor',$parstack,$safeeval) ne 'no')) { + && ($Apache::lonhomework::type ne 'exam') && ($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') + && (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoneditor') ne 'no')){ $result.=&Apache::response::edit_mathresponse_button($id,"HWVAL_$id"); } @@ -1159,7 +1161,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)) {