version 1.84, 2004/05/27 04:25:13
|
version 1.87, 2004/06/09 21:16:43
|
Line 106 sub caparesponse_check {
|
Line 106 sub caparesponse_check {
|
} |
} |
} |
} |
|
|
if ($sig eq '') { |
($sig_ubound,$sig_lbound)=&LONCAPA_INTERNAL_get_sigrange($sig); |
$sig_lbound = 0; #SIG_LB_DEFAULT |
|
$sig_ubound =15; #SIG_UB_DEFAULT |
|
} else { |
|
($sig_lbound,$sig_ubound) = split /,/,$sig; |
|
if (!defined($sig_lbound)) { |
|
$sig_lbound = 0; #SIG_LB_DEFAULT |
|
$sig_ubound =15; #SIG_UB_DEFAULT |
|
} |
|
if (!defined($sig_ubound)) { $sig_ubound=$sig_lbound; } |
|
} |
|
my $reterror=""; |
my $reterror=""; |
my $result = &caparesponse_capa_check_answer($response,$answer,$type, |
my $result = &caparesponse_capa_check_answer($response,$answer,$type, |
$tol_type,$tol, |
$tol_type,$tol, |
Line 353 sub random_multivariate_normal {
|
Line 344 sub random_multivariate_normal {
|
my ($item_cnt,$seed,$mean,$covar) = @_; |
my ($item_cnt,$seed,$mean,$covar) = @_; |
my @oldseed=&random_get_seed(); |
my @oldseed=&random_get_seed(); |
&random_set_seed_from_phrase($seed); |
&random_set_seed_from_phrase($seed); |
@retArray=&math_random_multivariate_normal($item_cnt,@$mean,@$covar); |
my @retArray=&math_random_multivariate_normal($item_cnt,@$mean,@$covar); |
&random_set_seed(@oldseed); |
&random_set_seed(@oldseed); |
return @retArray; |
return @retArray; |
} |
} |
Line 363 sub random_multinomial {
|
Line 354 sub random_multinomial {
|
my @oldseed=&random_get_seed(); |
my @oldseed=&random_get_seed(); |
my @retArray; |
my @retArray; |
&random_set_seed_from_phrase($seed); |
&random_set_seed_from_phrase($seed); |
@retArray=&math_random_multinomial($item_cnt,@p); |
my @retArray=&math_random_multinomial($item_cnt,@p); |
&random_set_seed(@oldseed); |
&random_set_seed(@oldseed); |
return @retArray; |
return @retArray; |
} |
} |
Line 532 sub chemparse {
|
Line 523 sub chemparse {
|
$formula .= $molecule.' '; |
$formula .= $molecule.' '; |
} |
} |
# get rid of trailing space |
# get rid of trailing space |
$formula =~ s/(\Q${nbsp}\E| )$//; |
$formula =~ s/(\ \;| )$//; |
|
|
return &xmlparse($formula); |
return &xmlparse($formula); |
} |
} |
Line 544 sub prettyprint {
|
Line 535 sub prettyprint {
|
if ($fmt =~ /chem/i) { return(&chemparse($value)); } |
if ($fmt =~ /chem/i) { return(&chemparse($value)); } |
my ($dollarmode,$commamode,$alwaysperiod,$options); |
my ($dollarmode,$commamode,$alwaysperiod,$options); |
if ($fmt =~ /^([^\d]*)(.*)/) { $options=$1; $fmt=$2; } |
if ($fmt =~ /^([^\d]*)(.*)/) { $options=$1; $fmt=$2; } |
if ($options =~ /\$/) { $dollamode=1; } |
if ($options =~ /\$/) { $dollarmode=1; } |
if ($options =~ /,/) { $commamode=1; } |
if ($options =~ /,/) { $commamode=1; } |
if ($options =~ /\./) { $alwaysperiod=1; } |
if ($options =~ /\./) { $alwaysperiod=1; } |
if ($fmt) { $value=sprintf('%.'.$fmt,$value); } |
if ($fmt) { $value=sprintf('%.'.$fmt,$value); } |
Line 577 sub prettyprint {
|
Line 568 sub prettyprint {
|
} |
} |
} else { |
} else { |
$result=$value; |
$result=$value; |
if ($dollarmode) { $result=&dollarformat($result,$target); } |
if ($dollarmode) { $result=&dollarformat($result,$target); } |
if ($commamode) { $result=&commaformat($result,$target); } |
elsif ($commamode) { $result=&commaformat($result,$target); } |
} |
} |
return $result; |
return $result; |
} |
} |