--- loncom/homework/caparesponse/caparesponse.pm 2004/03/12 21:06:19 1.141 +++ loncom/homework/caparesponse/caparesponse.pm 2004/03/13 00:36:11 1.142 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.141 2004/03/12 21:06:19 albertel Exp $ +# $Id: caparesponse.pm,v 1.142 2004/03/13 00:36:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,12 +161,22 @@ sub end_numericalresponse { ($result,my @msgs) = &Apache::run::run($expression,$safeeval); &Apache::lonxml::debug('msgs are'.join(':',@msgs)); - my ($awards) = split /:/ , $result; - ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards); + my ($awards)=split(/:/,$result); + my (@awards) = split(/,/,$awards); + ($ad,my $msg) = &Apache::inputtags::finalizeawards(\@awards,\@msgs); + &Apache::lonxml::debug('ad is'.$ad); + if ($ad eq 'SIG_FAIL') { + my ($sig_u,$sig_l)= + &get_sigrange($Apache::inputtags::params{'sig'}); + $msg=join(':',$msg,$sig_l,$sig_u); + &Apache::lonxml::debug("sigs bad $sig_u $sig_l ". + $Apache::inputtags::params{'sig'}); + } &Apache::lonxml::debug("$expression"); &Apache::lonxml::debug("\n
result:$result:$Apache::lonxml::curdepth
\n"); &Apache::response::handle_previous(\%previous,$ad); $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad; + $Apache::lonhomework::results{"resource.$partid.$id.awardmsg"}=$msg; $result=''; } } @@ -598,7 +608,7 @@ sub end_stringresponse { $Apache::lonhomework::results{"resource.$part.$id.submission"}= $response; - my $ad; + my ($ad,$msg); if ($type eq 're' ) { # if the RE wasn't in a var it likely got munged, # thus grab it from the var directly @@ -625,14 +635,17 @@ sub end_stringresponse { $expression.="');"; &Apache::lonxml::debug('answer is'.join(':',$answer)); @{$safeeval->varglob('CAPARESPONSE_CHECK_LIST_answer')}=($answer); - $result = &Apache::run::run($expression,$safeeval); - my ($awards) = split /:/ , $result; - ($ad) = &Apache::inputtags::finalizeawards(split /,/ , $awards); + ($result, my @msgs) = &Apache::run::run($expression,$safeeval); + &Apache::lonxml::debug('msgs are'.join(':',@msgs)); + my ($awards)=split(/:/,$result); + my (@awards) = split(/,/,$awards); + ($ad,$msg) = &Apache::inputtags::finalizeawards(\@awards,\@msgs); &Apache::lonxml::debug("$expression"); &Apache::lonxml::debug("\n
result:$result:$Apache::lonxml::curdepth
\n"); } &Apache::response::handle_previous(\%previous,$ad); $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad; + $Apache::lonhomework::results{"resource.$part.$id.awardmsg"}=$msg; } } } elsif ($target eq 'web' || $target eq 'tex') {