--- loncom/homework/caparesponse/caparesponse.pm 2008/09/12 10:09:18 1.227.2.1 +++ 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.227.2.1 2008/09/12 10:09:18 raeburn Exp $ +# $Id: caparesponse.pm,v 1.227.2.2 2008/09/13 02:46:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -447,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) { @@ -464,7 +468,7 @@ sub check_submission { use Time::HiRes; my $t0 = [Time::HiRes::gettimeofday()]; my ($result,@msgs) = - &Apache::run::run("&caparesponse_check_list($tag)",$safeeval); + &Apache::run::run("&caparesponse_check_list()",$safeeval); &Apache::lonxml::debug("checking $name $result with $response took ".&Time::HiRes::tv_interval($t0)); &Apache::lonxml::debug('msgs are '.join(':',@msgs)); my ($awards)=split(/:/,$result); @@ -1171,13 +1175,15 @@ 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)) { &Apache::lonxml::debug(" doing $name with ".join(':',@{ $answer{$name}{'answers'} })); ${$safeeval->varglob('LONCAPA::CAPAresponse_answer')}=dclone($answer{$name}); - my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list($$tagstack[-1])",$safeeval); + my ($result, @msgs)=&Apache::run::run("&caparesponse_check_list()",$safeeval); &Apache::lonxml::debug('msgs are'.join(':',@msgs)); my ($awards)=split(/:/,$result); my (@awards) = split(/,/,$awards);