version 1.122.2.4.2.1, 2023/09/08 00:07:30
|
version 1.125, 2014/02/03 18:52:30
|
Line 52 package Apache::lonproblemstatistics;
|
Line 52 package Apache::lonproblemstatistics;
|
use strict; |
use strict; |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
use Apache::lonquickgrades(); |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon; |
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use Apache::lonstatistics; |
use Apache::lonstatistics; |
Line 182 my @Fields = (
|
Line 183 my @Fields = (
|
format => '%d', |
format => '%d', |
sortable => 'yes', |
sortable => 'yes', |
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Minimum Number of Tries', |
long_title => 'Minumum Number of Tries', |
selectable => 'yes', |
selectable => 'yes', |
defaultselected => 'yes', |
defaultselected => 'yes', |
}, |
}, |
Line 438 my @SeqFields = (
|
Line 439 my @SeqFields = (
|
format => '%4.2f', |
format => '%4.2f', |
sortable => 'no', |
sortable => 'no', |
graphable => 'no', |
graphable => 'no', |
long_title => 'Minimum Sequence Score', |
long_title => 'Minumum Sequence Score', |
selectable => 'yes', |
selectable => 'yes', |
defaultselected => 'no', |
defaultselected => 'no', |
}, |
}, |
Line 493 my @SeqFields = (
|
Line 494 my @SeqFields = (
|
format => '%4.2f', |
format => '%4.2f', |
sortable => 'no', |
sortable => 'no', |
graphable => 'no', |
graphable => 'no', |
long_title => 'Minimum Number of Correct Problems', |
long_title => 'Minumum Number of Correct Problems', |
selectable => 'yes', |
selectable => 'yes', |
defaultselected => 'no', |
defaultselected => 'no', |
}, |
}, |
Line 589 sub field_selection_input {
|
Line 590 sub field_selection_input {
|
$Str .= '<option value="all">'.&mt('all').'</option>'."\n"; |
$Str .= '<option value="all">'.&mt('all').'</option>'."\n"; |
foreach my $field (@Fields) { |
foreach my $field (@Fields) { |
next if ($field->{'selectable'} ne 'yes'); |
next if ($field->{'selectable'} ne 'yes'); |
$Str .= ' <option value="'.$field->{'name'}.'"'; |
$Str .= ' <option value="'.$field->{'name'}.'" '; |
if ($field->{'selected'} eq 'yes') { |
if ($field->{'selected'} eq 'yes') { |
$Str .= ' selected="selected"'; |
$Str .= 'selected="selected" '; |
} |
} |
$Str .= '>'.&mt($field->{'title'}).'</option>'."\n"; |
$Str .= '>'.&mt($field->{'title'}).'</option>'."\n"; |
} |
} |
Line 704 sub BuildProblemStatisticsPage {
|
Line 705 sub BuildProblemStatisticsPage {
|
# Finally let the user know we are here |
# Finally let the user know we are here |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Overall Problem Statistics', |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Overall Problem Statistics', |
'Statistics_Overall_Key')); |
'Statistics_Overall_Key')); |
|
&Apache::lonquickgrades::startGradeScreen($r,'statistics'); |
|
|
my $interface = &CreateInterface($r); |
my $interface = &CreateInterface($r); |
$r->print($interface); |
$r->print($interface); |
Line 757 sub BuildProblemStatisticsPage {
|
Line 759 sub BuildProblemStatisticsPage {
|
&Apache::lonstatistics::section_and_enrollment_description(). |
&Apache::lonstatistics::section_and_enrollment_description(). |
'</p>'); |
'</p>'); |
my $count = 0; |
my $count = 0; |
my $include_tools = 1; |
|
foreach my $seq (@sequences) { |
foreach my $seq (@sequences) { |
my @resources = |
my @resources = |
&Apache::lonstathelpers::get_resources($navmap,$seq,$include_tools); |
&Apache::lonstathelpers::get_resources($navmap,$seq); |
$count += scalar(@resources); |
$count += scalar(@resources); |
} |
} |
if ($count > 10) { |
if ($count > 10) { |
Line 1468 sub write_headers {
|
Line 1469 sub write_headers {
|
################################################## |
################################################## |
sub compute_statistics_on_sequence { |
sub compute_statistics_on_sequence { |
my ($seq) = @_; |
my ($seq) = @_; |
my $include_tools = 1; |
|
my @Data; |
my @Data; |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq,$include_tools)) { |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)) { |
foreach my $part (@{$res->parts}) { |
foreach my $part (@{$res->parts}) { |
next if (($res->is_survey($part)) || ($res->is_anonsurvey($part))) ; |
next if (($res->is_survey($part)) || ($res->is_anonsurvey($part))) ; |
# |
# |
Line 1648 Returns: integer between -1 and 1
|
Line 1648 Returns: integer between -1 and 1
|
############################################### |
############################################### |
sub compute_discrimination_factor { |
sub compute_discrimination_factor { |
my ($resource,$part,$seq) = @_; |
my ($resource,$part,$seq) = @_; |
my $include_tools = 1; |
|
my $symb = $resource->symb; |
my $symb = $resource->symb; |
my @Resources; |
my @Resources; |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq,$include_tools)){ |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)){ |
next if ($res->symb eq $symb); |
next if ($res->symb eq $symb); |
push (@Resources,$res->symb); |
push (@Resources,$res->symb); |
} |
} |
Line 1670 sub compute_discrimination_factor {
|
Line 1669 sub compute_discrimination_factor {
|
my $number_to_grab = int(scalar(@{$ranking})/4); |
my $number_to_grab = int(scalar(@{$ranking})/4); |
my $num_students = scalar(@{$ranking}); |
my $num_students = scalar(@{$ranking}); |
my @BottomSet = map { $_->[&Apache::loncoursedata::RNK_student()]; |
my @BottomSet = map { $_->[&Apache::loncoursedata::RNK_student()]; |
} @{$ranking}[0..$number_to_grab-1]; |
} @{$ranking}[0..$number_to_grab]; |
my @TopSet = |
my @TopSet = |
map { |
map { |
$_->[&Apache::loncoursedata::RNK_student()]; |
$_->[&Apache::loncoursedata::RNK_student()]; |
} @{$ranking}[-$number_to_grab..-1]; |
} @{$ranking}[-$number_to_grab..0]; |
if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') || |
if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') || |
! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) { |
! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) { |
return 'nan'; |
return 'nan'; |
Line 1715 sub compute_discrimination_factor {
|
Line 1714 sub compute_discrimination_factor {
|
############################################### |
############################################### |
sub compute_sequence_statistics { |
sub compute_sequence_statistics { |
my ($seq) = @_; |
my ($seq) = @_; |
my $include_tools = 1; |
|
my $symb = $seq->symb; |
my $symb = $seq->symb; |
my @Resources; |
my @Resources; |
my $part_count; |
my $part_count; |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq,$include_tools)) { |
foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)) { |
push (@Resources,$res->symb); |
push (@Resources,$res->symb); |
$part_count += scalar(@{$res->parts}); |
$part_count += scalar(@{$res->parts}); |
} |
} |