version 1.221.2.1, 2011/10/08 20:51:30
|
version 1.224, 2011/06/06 17:43:51
|
Line 179 sub setrandomnumber {
|
Line 179 sub setrandomnumber {
|
} else { |
} else { |
($rndmod,$rndmod2)=&Apache::lonnet::digest("$id1,$id2"); |
($rndmod,$rndmod2)=&Apache::lonnet::digest("$id1,$id2"); |
} |
} |
|
$Apache::lonhomework::results{'resource.'.$id1.'.rawrndseed'}=$rndseed; |
if ($rndseed =~/([,:])/) { |
if ($rndseed =~/([,:])/) { |
my $char=$1; |
my $char=$1; |
use integer; |
use integer; |
Line 196 sub setrandomnumber {
|
Line 196 sub setrandomnumber {
|
} |
} |
} |
} |
&Apache::lonxml::debug("randseed $rndmod $rndseed"); |
&Apache::lonxml::debug("randseed $rndmod $rndseed"); |
|
$Apache::lonhomework::results{'resource.'.$id1.'.rndseed'}=$rndseed; |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
&Apache::lonnet::setup_random_from_rndseed($rndseed); |
return ''; |
return ''; |
} |
} |
Line 321 sub check_for_previous {
|
Line 322 sub check_for_previous {
|
next if (($questiontype eq 'randomizetry') && |
next if (($questiontype eq 'randomizetry') && |
($curr_rndseed ne $Apache::lonhomework::history{"$history:resource.$partid.rndseed"})); |
($curr_rndseed ne $Apache::lonhomework::history{"$history:resource.$partid.rndseed"})); |
push (@{$previous{'versionci'}},$history); |
push (@{$previous{'versionci'}},$history); |
$previous{'awardci'} = $Apache::lonhomework::history{"$history:resource.$partid.$id.awarddetail"}; |
$previous{'awardci'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"}; |
$previous{'usedci'} = 1; |
$previous{'usedci'} = 1; |
} |
} |
} |
} |
Line 1140 sub whichorder {
|
Line 1141 sub whichorder {
|
|
|
sub show_answer { |
sub show_answer { |
my $part = $Apache::inputtags::part; |
my $part = $Apache::inputtags::part; |
my $award = $Apache::lonhomework::history{"resource.$part.solved"}; |
my $award = $Apache::lonhomework::history{"resource.$part.awarded"}; |
my $status = $Apache::inputtags::status[-1]; |
my $status = $Apache::inputtags::status[-1]; |
return ( ($award =~ /^correct/ |
return ( ($award ==1 |
&& &Apache::lonhomework::show_problem_status()) |
&& &Apache::lonhomework::show_problem_status()) |
|| $status eq "SHOW_ANSWER"); |
|| $status eq "SHOW_ANSWER"); |
} |
} |