version 1.100, 2004/06/29 22:32:14
|
version 1.110, 2004/12/07 16:19:37
|
Line 46 sub start_response {
|
Line 46 sub start_response {
|
push (@Apache::inputtags::response,$id); |
push (@Apache::inputtags::response,$id); |
push (@Apache::inputtags::responselist,$id); |
push (@Apache::inputtags::responselist,$id); |
@Apache::inputtags::inputlist=(); |
@Apache::inputtags::inputlist=(); |
if ($Apache::inputtags::part eq '') { |
if ($Apache::inputtags::part eq '' && |
|
!$Apache::lonhomework::ignore_response_errors) { |
&Apache::lonxml::error(&HTML::Entities::encode(&mt("Found a <*response> outside of a <part> in a <part>ed problem"),'<>&"')); |
&Apache::lonxml::error(&HTML::Entities::encode(&mt("Found a <*response> outside of a <part> in a <part>ed problem"),'<>&"')); |
} |
} |
if ($Apache::inputtags::response_with_no_part && |
if ($Apache::inputtags::response_with_no_part && |
Line 123 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])) { |
|
$rndmod+=&Apache::lonnet::numval3($Apache::inputtags::response[-1]); |
|
} |
} |
} |
if ($rndseed =~/([,:])/) { |
if ($rndseed =~/([,:])/) { |
my $char=$1; |
my $char=$1; |
Line 135 sub setrandomnumber {
|
Line 141 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::lonnet::setup_random_from_rndseed($rndseed); |
|
&Apache::lonxml::debug("randseed $rndseed"); |
&Apache::lonxml::debug("randseed $rndseed"); |
|
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
return ''; |
return ''; |
} |
} |
|
|
Line 267 sub handle_previous {
|
Line 278 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 499 sub answer_footer {
|
Line 511 sub answer_footer {
|
} |
} |
|
|
sub showallfoils { |
sub showallfoils { |
my $return=0; |
if (defined($ENV{'form.showallfoils'})) { |
if (defined($ENV{'form.showallfoils'}) && |
my ($symb)=&Apache::lonxml::whichuser(); |
$ENV{'request.state'} eq 'construct') { |
if ($ENV{'request.state'} eq 'construct' || |
$return=1; |
($ENV{'user.adv'} && $symb eq '')) { |
|
return 1; |
|
} |
} |
} |
return $return; |
if ($Apache::lonhomework::type eq 'survey') { return 1; } |
|
return 0; |
} |
} |
|
|
sub getresponse { |
sub getresponse { |
Line 529 sub getresponse {
|
Line 544 sub getresponse {
|
$Apache::lonhomework::results{"resource.$part.$id.scantron"}.= |
$Apache::lonhomework::results{"resource.$part.$id.scantron"}.= |
$response; |
$response; |
if ($resulttype ne 'letter') { |
if ($resulttype ne 'letter') { |
$response = $let_to_num{$response}; |
if ($resulttype eq 'A is 1') { |
|
$response = $let_to_num{$response}+1; |
|
} else { |
|
$response = $let_to_num{$response}; |
|
} |
} |
} |
} else { |
} else { |
$response = $ENV{$formparm}; |
$response = $ENV{$formparm}; |
Line 639 sub analyze_store_foilgroup {
|
Line 658 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; |
} |
} |