version 1.107, 2004/10/21 03:19:04
|
version 1.116, 2005/03/28 23:19:45
|
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 { |
|
my $shift=(4*scalar(@Apache::inputtags::responselist))%30; |
|
$rndmod=(&Apache::lonnet::numval3($Apache::inputtags::part) << (($shift+15)%30)); |
|
if (defined($Apache::inputtags::response[-1])) { |
|
$rndmod+=(&Apache::lonnet::numval3($Apache::inputtags::response[-1]) << $shift ); |
|
} |
} |
} |
if ($rndseed =~/([,:])/) { |
if ($rndseed =~/([,:])/) { |
my $char=$1; |
my $char=$1; |
Line 136 sub setrandomnumber {
|
Line 142 sub setrandomnumber {
|
my ($num1,$num2)=split(/\Q$char\E/,$rndseed); |
my ($num1,$num2)=split(/\Q$char\E/,$rndseed); |
$num1+=$rndmod; |
$num1+=$rndmod; |
$num2+=$rndmod; |
$num2+=$rndmod; |
|
if($Apache::lonnet::_64bit) { $num1=(($num1<<32)>>32); $num2=(($num2<<32)>>32); } |
$rndseed=$num1.$char.$num2; |
$rndseed=$num1.$char.$num2; |
} else { |
} else { |
$rndseed+=$rndmod; |
$rndseed+=$rndmod; |
|
if($Apache::lonnet::_64bit) { |
|
use integer; |
|
$rndseed=(($rndseed<<32)>>32); |
|
} |
} |
} |
|
&Apache::lonxml::debug("randseed $rndmod $rndseed"); |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
&Apache::lonxml::debug("randseed $rndseed"); |
|
return ''; |
return ''; |
} |
} |
|
|
Line 420 sub end_responseparam {
|
Line 431 sub end_responseparam {
|
} |
} |
|
|
sub start_parameter { |
sub start_parameter { |
my $result = &start_responseparam(@_); |
return &start_responseparam(@_); |
return $result; |
|
} |
} |
|
|
sub end_parameter { |
sub end_parameter { |
my $result = &end_responseparam(@_); |
return &end_responseparam(@_); |
return $result; |
|
} |
} |
|
|
sub reset_params { |
sub reset_params { |
Line 504 sub showallfoils {
|
Line 513 sub showallfoils {
|
if (defined($ENV{'form.showallfoils'})) { |
if (defined($ENV{'form.showallfoils'})) { |
my ($symb)=&Apache::lonxml::whichuser(); |
my ($symb)=&Apache::lonxml::whichuser(); |
if ($ENV{'request.state'} eq 'construct' || |
if ($ENV{'request.state'} eq 'construct' || |
($ENV{'user.adv'} && $symb eq '')) { |
$ENV{'user.adv'} ) { |
return 1; |
return 1; |
} |
} |
} |
} |
|
if ($Apache::lonhomework::type eq 'survey') { return 1; } |
return 0; |
return 0; |
} |
} |
|
|
Line 703 sub get_response_param {
|
Line 713 sub get_response_param {
|
return $parameter; |
return $parameter; |
} |
} |
|
|
|
sub submitted { |
|
my ($who)=@_; |
|
|
|
# when scatron grading any submission is a submission |
|
if ($ENV{'form.submitted'} eq 'scantron') { return 1; } |
|
# if the caller only cared if this was a scantron submission |
|
if ($who eq 'scantron') { return 0; } |
|
# if the Submit Answer button for this particular part was pressed |
|
my $partid=$Apache::inputtags::part; |
|
if (defined($ENV{'form.submit_'.$partid})) { return 1; } |
|
# otherwise no submission occured |
|
return 0; |
|
} |
1; |
1; |
__END__ |
__END__ |
|
|