version 1.86, 2004/05/18 18:12:19
|
version 1.91, 2004/07/22 15:56:41
|
Line 263 my @Fields = (
|
Line 263 my @Fields = (
|
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Degree of Discrimination', |
long_title => 'Degree of Discrimination', |
selectable => 'yes', |
selectable => 'yes', |
defaultselected => 'no', |
defaultselected => 'yes', |
}, |
}, |
## duedate included for research purposes. Commented out most of the time. |
## duedate included for research purposes. Commented out most of the time. |
# { name => 'duedate', |
# { name => 'duedate', |
Line 547 select sections, maps, and output.
|
Line 547 select sections, maps, and output.
|
############################################### |
############################################### |
############################################### |
############################################### |
sub CreateInterface { |
sub CreateInterface { |
|
my ($r) = @_; |
# |
# |
&parse_field_selection(); |
&parse_field_selection(); |
# |
# |
Line 582 sub CreateInterface {
|
Line 583 sub CreateInterface {
|
$Str .= '</td><td>'.&field_selection_input(); |
$Str .= '</td><td>'.&field_selection_input(); |
$Str .= '</td></tr>'."\n"; |
$Str .= '</td></tr>'."\n"; |
$Str .= '</table>'."\n"; |
$Str .= '</table>'."\n"; |
|
# |
|
$Str .= '<p>'.&mt('Status: [_1]', |
|
'<input type="text" '. |
|
'name="stats_status" size="60" value="" />' |
|
). |
|
'</nobr></p>'; |
|
# |
$Str .= '<input type="submit" name="GenerateStatistics" value="'. |
$Str .= '<input type="submit" name="GenerateStatistics" value="'. |
&mt('Generate Statistics').'" />'; |
&mt('Generate Statistics').'" />'; |
$Str .= ' 'x5; |
$Str .= ' 'x5; |
$Str .= 'Plot '.&plot_dropdown().(' 'x10); |
$Str .= 'Plot '.&plot_dropdown().(' 'x10); |
$Str .= '<input type="submit" name="ClearCache" value="'. |
# |
&mt('Clear Caches').'" />'; |
|
$Str .= ' 'x5; |
|
$Str .= '<input type="submit" name="UpdateCache" value="'. |
|
&mt('Update Student Data').'" />'; |
|
$Str .= ' 'x5; |
|
$Str .= '<input type="submit" name="Excel" value="'. |
|
&mt('Produce Excel Output').'" />'; |
|
$Str .= ' 'x5; |
|
return $Str; |
return $Str; |
} |
} |
|
|
Line 632 sub BuildProblemStatisticsPage {
|
Line 632 sub BuildProblemStatisticsPage {
|
undef(%SeqStat); |
undef(%SeqStat); |
# |
# |
# Finally let the user know we are here |
# Finally let the user know we are here |
my $interface = &CreateInterface(); |
my $interface = &CreateInterface($r); |
$r->print($interface); |
$r->print($interface); |
$r->print('<input type="hidden" name="sortby" value="'.$ENV{'form.sortby'}. |
$r->print('<input type="hidden" name="sortby" value="'.$ENV{'form.sortby'}. |
'" />'); |
'" />'); |
# |
# |
if (! exists($ENV{'form.statsfirstcall'})) { |
my @CacheButtonHTML = |
$r->print('<input type="hidden" name="statsfirstcall" value="yes" />'); |
&Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status'); |
|
my $Str; |
|
foreach my $html (@CacheButtonHTML) { |
|
$Str.=$html.(' 'x5); |
|
} |
|
# |
|
$r->print($Str); |
|
if (! exists($ENV{'form.firstrun'})) { |
$r->print('<h3>'. |
$r->print('<h3>'. |
&mt('Press "Generate Statistics" when you are ready.'). |
&mt('Press "Generate Statistics" when you are ready.'). |
'</h3><p>'. |
'</h3><p>'. |
Line 647 sub BuildProblemStatisticsPage {
|
Line 654 sub BuildProblemStatisticsPage {
|
' will not have this delay.'). |
' will not have this delay.'). |
'</p>'); |
'</p>'); |
return; |
return; |
} elsif ($ENV{'form.statsfirstcall'} eq 'yes' || |
|
exists($ENV{'form.UpdateCache'}) || |
|
exists($ENV{'form.ClearCache'}) ) { |
|
$r->print('<input type="hidden" name="statsfirstcall" value="no" />'); |
|
&Apache::lonstatistics::Gather_Student_Data($r); |
|
} else { |
|
$r->print('<input type="hidden" name="statsfirstcall" value="no" />'); |
|
} |
} |
$r->rflush(); |
$r->rflush(); |
# |
# |
Line 663 sub BuildProblemStatisticsPage {
|
Line 663 sub BuildProblemStatisticsPage {
|
# |
# |
if (exists($ENV{'form.Excel'})) { |
if (exists($ENV{'form.Excel'})) { |
&Excel_output($r); |
&Excel_output($r); |
} else { |
} else { |
|
$r->print('<input type="submit" name="Excel" value="'. |
|
&mt('Produce Excel Output').'" />'.' 'x5); |
|
$r->rflush(); |
my $count = 0; |
my $count = 0; |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { |
$count += $seq->{'num_assess_parts'}; |
$count += $seq->{'num_assess_parts'}; |
Line 701 sub BuildProblemStatisticsPage {
|
Line 704 sub BuildProblemStatisticsPage {
|
sub output_sequence_statistics { |
sub output_sequence_statistics { |
my ($r) = @_; |
my ($r) = @_; |
my $c=$r->connection(); |
my $c=$r->connection(); |
$r->print('<h2>'.&mt('Sequence Statistics').'</h2>'); |
$r->print('<h2>'.&mt('Sequence Statistics'). |
|
&Apache::loncommon::help_open_topic('Statistics_Sequence'). |
|
'</h2>'); |
$r->print('<table border="0"><tr><td bgcolor="#777777">'."\n". |
$r->print('<table border="0"><tr><td bgcolor="#777777">'."\n". |
'<table border="0" cellpadding="3">'."\n". |
'<table border="0" cellpadding="3">'."\n". |
'<tr bgcolor="#FFFFE6">'); |
'<tr bgcolor="#FFFFE6">'); |
Line 1384 sub compute_statistics_on_sequence {
|
Line 1389 sub compute_statistics_on_sequence {
|
foreach my $res (@{$seq->{'contents'}}) { |
foreach my $res (@{$seq->{'contents'}}) { |
next if ($res->{'type'} ne 'assessment'); |
next if ($res->{'type'} ne 'assessment'); |
foreach my $part (@{$res->{'parts'}}) { |
foreach my $part (@{$res->{'parts'}}) { |
|
next if ($res->{'partdata'}->{$part}->{'Survey'}); |
# |
# |
# This is where all the work happens |
# This is where all the work happens |
my $data = &get_statistics($seq,$res,$part,scalar(@StatsArray)+1); |
my $data = &get_statistics($seq,$res,$part,scalar(@StatsArray)+1); |
Line 1575 sub compute_discrimination_factor {
|
Line 1581 sub compute_discrimination_factor {
|
map { |
map { |
$_->[&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)]; |
|
if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') || |
|
! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) { |
|
return 'nan'; |
|
} |
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); |
undef,$starttime,$endtime); |