version 1.63, 2011/09/19 04:02:20
|
version 1.63.2.3, 2011/11/22 01:34:39
|
Line 30 use strict;
|
Line 30 use strict;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonquickgrades(); |
|
use Apache::loncoursedata(); |
use Apache::loncoursedata(); |
use Apache::lonstatistics; |
use Apache::lonstatistics; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonstathelpers; |
use Apache::lonstathelpers; |
|
use Apache::lonmsgdisplay(); |
use HTML::Entities(); |
use HTML::Entities(); |
use Time::Local(); |
use Time::Local(); |
use Spreadsheet::WriteExcel(); |
use Spreadsheet::WriteExcel(); |
Line 62 sub BuildStudentSubmissionsPage {
|
Line 62 sub BuildStudentSubmissionsPage {
|
# |
# |
&Apache::lonstatistics::PrepareClasslist(); |
&Apache::lonstatistics::PrepareClasslist(); |
# |
# |
$r->print( &Apache::lonhtmlcommon::breadcrumbs('Student Submission Reports')); |
|
&Apache::lonquickgrades::startGradeScreen($r,'statistics'); |
|
$r->print(&CreateInterface()); |
$r->print(&CreateInterface()); |
# |
# |
my @Students = @Apache::lonstatistics::Students; |
my @Students = @Apache::lonstatistics::Students; |
Line 324 sub prepare_html_output {
|
Line 322 sub prepare_html_output {
|
my @extra_resp_headers = &get_extra_response_headers($show_named); |
my @extra_resp_headers = &get_extra_response_headers($show_named); |
# |
# |
# Create the table header |
# Create the table header |
my @student_columns; |
my @student_columns = &get_student_columns($show_named); |
if ($show_named) { |
|
@student_columns = @Apache::lonstatistics::SelectedStudentData; |
|
if (grep(/^all$/,@student_columns)) { |
|
@student_columns = qw(fullname username domain id section status groups comments); |
|
} |
|
} else { |
|
@student_columns = ('username'); |
|
} |
|
# |
|
my %headers; |
my %headers; |
my $student_column_count = scalar(@student_columns); |
my $student_column_count = scalar(@student_columns); |
$headers{'problem'} = qq{<th colspan="$student_column_count">\ </th>}; |
$headers{'problem'} = qq{<th colspan="$student_column_count">\ </th>}; |
foreach (@student_columns) { |
foreach my $field (@student_columns) { |
$headers{'student'}.= '<th>'.ucfirst($_).'</th>'; |
$headers{'student'}.= '<th>'.ucfirst($field).'</th>'; |
} |
} |
# |
# |
# we put the headers into the %headers hash |
# we put the headers into the %headers hash |
my $total_col = scalar(@student_columns); |
my $total_col = $student_column_count; |
my $nonempty_part_headers = 0; |
my $nonempty_part_headers = 0; |
# |
# |
my %problem_analysis; |
my %problem_analysis; |
Line 839 sub prepare_excel_output {
|
Line 828 sub prepare_excel_output {
|
$worksheet->write($partid_row,0,'Part ID',$format->{'bold'}); |
$worksheet->write($partid_row,0,'Part ID',$format->{'bold'}); |
$worksheet->write($respid_row,0,'Response ID',$format->{'bold'}); |
$worksheet->write($respid_row,0,'Response ID',$format->{'bold'}); |
# Student headers |
# Student headers |
my @StudentColumns; |
my @StudentColumns = &get_student_columns($show_named); |
if ($show_named) { |
foreach my $field (@StudentColumns) { |
@StudentColumns = qw(username domain id section); |
$worksheet->write($header_row,$cols_output++,ucfirst($field), |
} else { |
|
@StudentColumns = qw(username); |
|
} |
|
foreach (@StudentColumns) { |
|
$worksheet->write($header_row,$cols_output++,ucfirst($_), |
|
$format->{'bold'}); |
$format->{'bold'}); |
} |
} |
# Problem headers |
# Problem headers |
Line 897 sub prepare_excel_output {
|
Line 881 sub prepare_excel_output {
|
last if ($c->aborted()); |
last if ($c->aborted()); |
$cols_output = 0; |
$cols_output = 0; |
my $student_row = $max_row; |
my $student_row = $max_row; |
foreach my $field (@StudentColumns) { |
|
$cols_output ++; |
|
} |
|
foreach my $prob (@$Problems) { |
foreach my $prob (@$Problems) { |
my $symb = $prob->symb(); |
my $symb = $prob->symb(); |
foreach my $partid (@{$prob->parts}) { |
foreach my $partid (@{$prob->parts}) { |
Line 959 sub prepare_excel_output {
|
Line 940 sub prepare_excel_output {
|
my $cols = 0; |
my $cols = 0; |
foreach my $field (@StudentColumns) { |
foreach my $field (@StudentColumns) { |
if ($show_named) { |
if ($show_named) { |
$worksheet->write($row,$cols++, |
my $value = $student->{$field}; |
$student->{$field}); |
if ($field eq 'comments') { |
|
$value = &Apache::lonmsgdisplay::retrieve_instructor_comments |
|
($student->{'username'},$student->{'domain'}); |
|
} |
|
$worksheet->write($row,$cols++,$value); |
} else { |
} else { |
$worksheet->write($row,$cols++, |
$worksheet->write($row,$cols++, |
&mt('Anonymized')); |
&mt('Anonymized')); |
Line 1109 sub prepare_csv_output {
|
Line 1094 sub prepare_csv_output {
|
my @extra_resp_headers = &get_extra_response_headers($show_named); |
my @extra_resp_headers = &get_extra_response_headers($show_named); |
# |
# |
# Create the table header |
# Create the table header |
my @student_columns = ('username','domain','id','section'); |
my @student_columns = &get_student_columns($show_named); |
if ($show_named) { |
|
@student_columns = qw(username domain id section); |
|
} else { |
|
@student_columns = qw(username); |
|
} |
|
my $student_column_count = scalar(@student_columns); |
my $student_column_count = scalar(@student_columns); |
# |
# |
my %headers; |
my %headers; |
Line 1127 sub prepare_csv_output {
|
Line 1107 sub prepare_csv_output {
|
# we put the headers into the %headers hash |
# we put the headers into the %headers hash |
my %problem_analysis; |
my %problem_analysis; |
my %start_col; |
my %start_col; |
my $max_column = scalar(@student_columns); |
my $max_column = $student_column_count; |
foreach my $prob (@$problems) { |
foreach my $prob (@$problems) { |
my $symb = $prob->symb(); |
my $symb = $prob->symb(); |
my %analysis = &Apache::lonstathelpers::get_problem_data($prob->src); |
my %analysis = &Apache::lonstathelpers::get_problem_data($prob->src); |
Line 1218 sub prepare_csv_output {
|
Line 1198 sub prepare_csv_output {
|
foreach my $row (@rows) { |
foreach my $row (@rows) { |
my $student_row_data = ''; |
my $student_row_data = ''; |
if ($show_named) { |
if ($show_named) { |
$student_row_data = '"'.join('","', |
foreach my $field (@student_columns) { |
map { $student->{$_}; } |
my $value = $student->{$field}; |
@student_columns).'"'; |
if ($field eq 'comments') { |
|
$value = &Apache::lonmsgdisplay::retrieve_instructor_comments |
|
($student->{'username'},$student->{'domain'}); |
|
} |
|
$student_row_data .= '"'.&Apache::loncommon::csv_translate($value).'",'; |
|
} |
|
$student_row_data =~ s/,$//; |
} else { |
} else { |
$student_row_data = '"'.&mt('Anonymized').'"'; |
$student_row_data = '"'.&mt('Anonymized').'"'; |
} |
} |
Line 1279 sub CreateInterface {
|
Line 1265 sub CreateInterface {
|
## |
## |
## Environment variable initialization |
## Environment variable initialization |
my $Str = ''; |
my $Str = ''; |
|
$Str .= &Apache::lonhtmlcommon::breadcrumbs('Student Submission Reports'); |
$Str .= '<br />'; |
$Str .= '<br />'; |
$Str .= &Apache::loncommon::start_data_table(); |
$Str .= &Apache::loncommon::start_data_table(); |
$Str .= &Apache::loncommon::start_data_table_header_row(); |
$Str .= &Apache::loncommon::start_data_table_header_row(); |
Line 1367 sub CreateInterface {
|
Line 1354 sub CreateInterface {
|
return $Str; |
return $Str; |
} |
} |
|
|
|
sub get_student_columns { |
|
my ($show_named) = @_; |
|
my @student_columns; |
|
if ($show_named) { |
|
@student_columns = @Apache::lonstatistics::SelectedStudentData; |
|
if (grep(/^all$/,@student_columns)) { |
|
@student_columns = qw(fullname username domain id section status groups comments); |
|
} |
|
} else { |
|
@student_columns = ('username'); |
|
} |
|
return @student_columns; |
|
} |
|
|
1; |
1; |
|
|
__END__ |
__END__ |