version 1.60, 2003/10/24 13:36:16
|
version 1.69, 2004/03/01 16:39:19
|
Line 51 package Apache::lonproblemstatistics;
|
Line 51 package Apache::lonproblemstatistics;
|
|
|
use strict; |
use strict; |
use Apache::lonnet(); |
use Apache::lonnet(); |
|
use Apache::loncommon(); |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon; |
use Apache::loncoursedata; |
use Apache::loncoursedata; |
use Apache::lonstatistics; |
use Apache::lonstatistics; |
Line 146 my @Fields = (
|
Line 147 my @Fields = (
|
title => '#YES', |
title => '#YES', |
align => 'right', |
align => 'right', |
color => '#FFDDDD', |
color => '#FFDDDD', |
format => '%d', |
format => '%4.1f',# format => '%d', |
sortable => 'yes', |
sortable => 'yes', |
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Number of Students able to Solve' }, |
long_title => 'Number of Students able to Solve' }, |
Line 154 my @Fields = (
|
Line 155 my @Fields = (
|
title => '#yes', |
title => '#yes', |
align => 'right', |
align => 'right', |
color => '#FFDDDD', |
color => '#FFDDDD', |
format => '%d', |
format => '%4.1f',# format => '%d', |
sortable => 'yes', |
sortable => 'yes', |
graphable => 'yes', |
graphable => 'yes', |
long_title => 'Number of Students given Override' }, |
long_title => 'Number of Students given Override' }, |
Line 207 my @OutputOptions =
|
Line 208 my @OutputOptions =
|
|
|
sub CreateInterface { |
sub CreateInterface { |
my $Str = ''; |
my $Str = ''; |
|
$Str .= &Apache::lonhtmlcommon::breadcrumbs |
|
(undef,'Overall Problem Statistics','Statistics_Overall_Key'); |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<table cellspacing="5">'."\n"; |
$Str .= '<tr>'; |
$Str .= '<tr>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
Line 265 Main interface to problem statistics.
|
Line 268 Main interface to problem statistics.
|
sub BuildProblemStatisticsPage { |
sub BuildProblemStatisticsPage { |
my ($r,$c)=@_; |
my ($r,$c)=@_; |
# |
# |
|
my %Saveable_Parameters = ('Status' => 'scalar', |
|
'statsoutputmode' => 'scalar', |
|
'Section' => 'array', |
|
'StudentData' => 'array', |
|
'Maps' => 'array'); |
|
&Apache::loncommon::store_course_settings('statistics', |
|
\%Saveable_Parameters); |
|
&Apache::loncommon::restore_course_settings('statistics', |
|
\%Saveable_Parameters); |
|
# |
|
&Apache::lonstatistics::PrepareClasslist(); |
|
# |
my ($interface,$output_mode,$show) = &CreateInterface(); |
my ($interface,$output_mode,$show) = &CreateInterface(); |
$r->print($interface); |
$r->print($interface); |
$r->print('<input type="hidden" name="statsfirstcall" value="no" />'); |
$r->print('<input type="hidden" name="statsfirstcall" value="no" />'); |
Line 517 sub output_excel {
|
Line 532 sub output_excel {
|
if (length($sheetname) > 31) { |
if (length($sheetname) > 31) { |
$sheetname = substr($sheetname,0,31); |
$sheetname = substr($sheetname,0,31); |
} |
} |
$excel_sheet = $excel_workbook->addworksheet($sheetname); |
$excel_sheet = $excel_workbook->addworksheet( |
|
&Apache::loncommon::clean_excel_name($sheetname) |
|
); |
# |
# |
# Put the course description in the header |
# Put the course description in the header |
$excel_sheet->write($rows_output,$cols_output++, |
$excel_sheet->write($rows_output,$cols_output++, |
Line 755 sub plot_statistics {
|
Line 772 sub plot_statistics {
|
'Problem Number', |
'Problem Number', |
$yaxis, |
$yaxis, |
$Max, |
$Max, |
undef, |
undef, # colors |
|
undef, # labels |
\@Data)."</p>\n"); |
\@Data)."</p>\n"); |
# |
# |
# Print out the data |
# Print out the data |
Line 770 sub get_statistics {
|
Line 788 sub get_statistics {
|
my $symb = $resource->{'symb'}; |
my $symb = $resource->{'symb'}; |
my $courseid = $ENV{'request.course.id'}; |
my $courseid = $ENV{'request.course.id'}; |
# |
# |
my $students = \@Apache::lonstatistics::Students; |
|
if ($Apache::lonstatistics::SelectedSections[0] eq 'all') { |
|
$students = undef; |
|
} |
|
my $data = &Apache::loncoursedata::get_problem_statistics |
my $data = &Apache::loncoursedata::get_problem_statistics |
($students,$symb,$part,$courseid); |
(\@Apache::lonstatistics::SelectedSections, |
|
$Apache::lonstatistics::enrollment_status, |
|
$symb,$part,$courseid); |
$data->{'part'} = $part; |
$data->{'part'} = $part; |
$data->{'problem_num'} = $problem_num; |
$data->{'problem_num'} = $problem_num; |
$data->{'container'} = $sequence->{'title'}; |
$data->{'container'} = $sequence->{'title'}; |