version 1.82, 2004/04/01 22:13:39
|
version 1.83, 2004/04/06 15:45:13
|
Line 1451 sub get_statistics {
|
Line 1451 sub get_statistics {
|
$data->{'deg_of_disc'} = |
$data->{'deg_of_disc'} = |
&compute_discrimination_factor($resource,$part,$sequence); |
&compute_discrimination_factor($resource,$part,$sequence); |
} |
} |
|
# |
|
# Store in metadata if computations were done for all students |
|
if ($Apache::lonstatistics::SelectedSections[0] eq 'all' && |
|
$data->{'num_students'} > 1) { |
|
my %storestats; |
|
# |
|
my $urlres=(&Apache::lonnet::decode_symb($resource->{'symb'}))[2]; |
|
my ($dom,$user) = $urlres=~/^(\w+)\/(\w+)/; |
|
my $preamble = $courseid.'___'.$urlres.'___'; |
|
# |
|
$storestats{$preamble.'timestamp'} = time; |
|
$storestats{$preamble.'stdno'} = $data->{'num_students'}; |
|
$storestats{$preamble.'avetries'} = $data->{'mean_tries'}; |
|
$storestats{$preamble.'difficulty'} = $data->{'deg_of_diff'}; |
|
if ($SelectedFields{'deg_of_disc'}) { |
|
$storestats{$preamble.'discrimination'} = $data->{'deg_of_disc'}; |
|
} |
|
# |
|
&Apache::lonnet::put('nohist_resevaldata',\%storestats,$dom,$user); |
|
} |
return $data; |
return $data; |
} |
} |
|
|
Line 1478 sub compute_discrimination_factor {
|
Line 1498 sub compute_discrimination_factor {
|
} |
} |
# |
# |
# rank |
# rank |
|
my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits(); |
my $ranking = |
my $ranking = |
&Apache::loncoursedata::rank_students_by_scores_on_resources |
&Apache::loncoursedata::rank_students_by_scores_on_resources |
(\@Resources, |
(\@Resources, |
\@Apache::lonstatistics::SelectedSections, |
\@Apache::lonstatistics::SelectedSections, |
$Apache::lonstatistics::enrollment_status,undef); |
$Apache::lonstatistics::enrollment_status,undef, |
|
$starttime,$endtime); |
# |
# |
# compute their percent scores on the problems in the sequence, |
# compute their percent scores on the problems in the sequence, |
my $number_to_grab = int(scalar(@{$ranking})/4); |
my $number_to_grab = int(scalar(@{$ranking})/4); |
Line 1494 sub compute_discrimination_factor {
|
Line 1516 sub compute_discrimination_factor {
|
$_->[&Apache::loncoursedata::RNK_student()]; |
$_->[&Apache::loncoursedata::RNK_student()]; |
} @{$ranking}[($num_students-$number_to_grab)..($num_students-1)]; |
} @{$ranking}[($num_students-$number_to_grab)..($num_students-1)]; |
my ($bottom_sum,$bottom_max) = |
my ($bottom_sum,$bottom_max) = |
&Apache::loncoursedata::get_sum_of_scores($resource,$part,\@BottomSet); |
&Apache::loncoursedata::get_sum_of_scores($resource,$part,\@BottomSet, |
|
undef,$starttime,$endtime); |
my ($top_sum,$top_max) = |
my ($top_sum,$top_max) = |
&Apache::loncoursedata::get_sum_of_scores($resource,$part,\@TopSet); |
&Apache::loncoursedata::get_sum_of_scores($resource,$part,\@TopSet, |
|
undef,$starttime,$endtime); |
my $deg_of_disc; |
my $deg_of_disc; |
if ($top_max == 0 || $bottom_max==0) { |
if ($top_max == 0 || $bottom_max==0) { |
$deg_of_disc = 'nan'; |
$deg_of_disc = 'nan'; |