version 1.85, 2004/05/14 20:30:17
|
version 1.88, 2004/06/16 14:21:16
|
Line 298 my @Fields = (
|
Line 298 my @Fields = (
|
# selectable => 'no', |
# selectable => 'no', |
# defaultselected => 'yes', |
# defaultselected => 'yes', |
# }, |
# }, |
|
## resptypes included for research purposes. Commented out most of the time. |
|
# { name => 'resptypes', |
|
# title => 'Response Types', |
|
# align => 'left', |
|
# color => '#FFFFFF', |
|
# sortable => 'no', |
|
# graphable => 'no', |
|
# long_title => 'Response Types used in this problem', |
|
# selectable => 'no', |
|
# defaultselected => 'yes', |
|
# }, |
); |
); |
|
|
my @SeqFields = ( |
my @SeqFields = ( |
Line 536 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 571 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 621 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 636 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 652 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 1373 sub compute_statistics_on_sequence {
|
Line 1387 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 1519 sub get_statistics {
|
Line 1534 sub get_statistics {
|
# &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb); |
# &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb); |
# $data->{'opendate'} = |
# $data->{'opendate'} = |
# &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb); |
# &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb); |
|
# $data->{'resptypes'} = join(',',@{$resource->{'partdata'}->{$part}->{'ResponseTypes'}}); |
return $data; |
return $data; |
} |
} |
|
|