version 1.105.2.1, 2004/11/06 21:30:35
|
version 1.111, 2004/12/07 23:23:34
|
Line 124 sub setrandomnumber {
|
Line 124 sub setrandomnumber {
|
if (defined($Apache::inputtags::response[-1])) { |
if (defined($Apache::inputtags::response[-1])) { |
$rndmod+=&Apache::lonnet::numval($Apache::inputtags::response[-1]); |
$rndmod+=&Apache::lonnet::numval($Apache::inputtags::response[-1]); |
} |
} |
} else { |
} elsif ($rand_alg eq '64bit3') { |
$rndmod=(&Apache::lonnet::numval2($Apache::inputtags::part) << 10); |
$rndmod=(&Apache::lonnet::numval2($Apache::inputtags::part) << 10); |
if (defined($Apache::inputtags::response[-1])) { |
if (defined($Apache::inputtags::response[-1])) { |
$rndmod+=&Apache::lonnet::numval2($Apache::inputtags::response[-1]); |
$rndmod+=&Apache::lonnet::numval2($Apache::inputtags::response[-1]); |
} |
} |
|
} else { |
|
$rndmod=(&Apache::lonnet::numval3($Apache::inputtags::part) << 10); |
|
if (defined($Apache::inputtags::response[-1])) { |
|
my $shift=(4*scalar(@Apache::inputtags::response))%20; |
|
$rndmod+=(&Apache::lonnet::numval3($Apache::inputtags::response[-1]) << $shift ); |
|
} |
} |
} |
if ($rndseed =~/([,:])/) { |
if ($rndseed =~/([,:])/) { |
my $char=$1; |
my $char=$1; |
Line 145 sub setrandomnumber {
|
Line 151 sub setrandomnumber {
|
$rndseed=(($rndseed<<32)>>32); |
$rndseed=(($rndseed<<32)>>32); |
} |
} |
} |
} |
&Apache::lonxml::debug("randseed $rndseed"); |
&Apache::lonxml::debug("randseed $rndmod $rndseed"); |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
return ''; |
return ''; |
} |
} |
Line 273 sub handle_previous {
|
Line 279 sub handle_previous {
|
if ($$previous{'used'} && ($$previous{'award'} eq $ad) ) { |
if ($$previous{'used'} && ($$previous{'award'} eq $ad) ) { |
if ($$previous{'last'}) { |
if ($$previous{'last'}) { |
push(@Apache::inputtags::previous,'PREVIOUSLY_LAST'); |
push(@Apache::inputtags::previous,'PREVIOUSLY_LAST'); |
} else { |
push(@Apache::inputtags::previous_version,$$previous{'version'}); |
|
} elsif ($Apache::lonhomework::type ne 'survey') { |
push(@Apache::inputtags::previous,'PREVIOUSLY_USED'); |
push(@Apache::inputtags::previous,'PREVIOUSLY_USED'); |
|
push(@Apache::inputtags::previous_version,$$previous{'version'}); |
} |
} |
push(@Apache::inputtags::previous_version,$$previous{'version'}); |
|
} |
} |
} |
} |
|
|
Line 512 sub showallfoils {
|
Line 519 sub showallfoils {
|
return 1; |
return 1; |
} |
} |
} |
} |
|
if ($Apache::lonhomework::type eq 'survey') { return 1; } |
return 0; |
return 0; |
} |
} |
|
|
Line 651 sub analyze_store_foilgroup {
|
Line 659 sub analyze_store_foilgroup {
|
sub check_if_computed { |
sub check_if_computed { |
my ($token,$parstack,$safeeval,$name)=@_; |
my ($token,$parstack,$safeeval,$name)=@_; |
my $value = &Apache::lonxml::get_param($name,$parstack,$safeeval); |
my $value = &Apache::lonxml::get_param($name,$parstack,$safeeval); |
if ($value ne $token->[2]{$name}) { |
if (ref($token->[2]) eq 'HASH' && $value ne $token->[2]{$name}) { |
my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]"; |
my $part_id="$Apache::inputtags::part.$Apache::inputtags::response[-1]"; |
$Apache::lonhomework::analyze{"$part_id.answercomputed"} = 1; |
$Apache::lonhomework::analyze{"$part_id.answercomputed"} = 1; |
} |
} |