--- loncom/interface/statistics/lonstudentsubmissions.pm 2004/09/22 15:38:49 1.21
+++ loncom/interface/statistics/lonstudentsubmissions.pm 2004/09/23 14:55:24 1.24
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonstudentsubmissions.pm,v 1.21 2004/09/22 15:38:49 matthew Exp $
+# $Id: lonstudentsubmissions.pm,v 1.24 2004/09/23 14:55:24 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -126,6 +126,8 @@ sub BuildStudentSubmissionsPage {
}
if ($ENV{'form.output'} eq 'excel') {
&prepare_excel_output($r,\@Problems,\@Students);
+ } elsif ($ENV{'form.output'} eq 'csv') {
+ &prepare_csv_output($r,\@Problems,\@Students);
} else {
&prepare_html_output($r,\@Problems,\@Students);
}
@@ -217,7 +219,7 @@ sub prepare_html_output {
if (! $single_part) {
my $tmpname = $partid;
if ($partid =~/^\d+$/) {
- $tmpname = &mt('Part [_1]',$partid);
+ $tmpname = $prob->part_display($partid);
}
$headers{'part'} .= qq{
$tmpname
};
$nonempty_part_headers = 1;
@@ -226,7 +228,7 @@ sub prepare_html_output {
}
$prob_span += $part_span;
}
- my $title = &get_title($prob->title,$prob->src);
+ my $title = $prob->compTitle;
if ($prob_span > 0) {
$headers{'problem'}.= qq{
$title
};
} elsif ($single_response) {
@@ -388,9 +390,9 @@ sub html_essay_results {
}
my $Str;
if (! $single_response) {
- my $id = &get_title($prob->title,$prob->src);
+ my $id = $prob->compTitle;
if (defined($partid) && $partid ne '0') {
- $id .= ' '.$partid;
+ $id .= ' '.$prob->part_display($partid);
}
if (defined($respid)) {
$id .= ' '.$respid;
@@ -504,7 +506,7 @@ sub prepare_excel_output {
$r->print('
'.&mt('Unable to complete request').'
'.$/.
'
'.&mt('LON-CAPA is unable to produce your Excel spreadsheet because your selections will result in more than 255 columns. Excel allows only 255 columns in a spreadsheet.').'
'.$/.
'
'.&mt('Consider selecting fewer problems to generate reports on, or reducing the number of items per problem. Or use HTML or CSV output.').'
'.$/.
- '
'.&mt('The last problem that will fit in the current spreadsheet is [_1].',&get_title($lastprob->title,$lastprob->src)).'
');
+ '
'.&mt('The last problem that will fit in the current spreadsheet is [_1].',$lastprob->compTitle).'
');
$r->rflush();
return;
}
@@ -563,11 +565,12 @@ sub prepare_excel_output {
}
# Problem headers
foreach my $prob (@$Problems) {
- my $title = &get_title($prob->title,$prob->src);
+ my $title = $prob->compTitle;
$worksheet->write($title_row,$cols_output,
$title,$format->{'h3'});
foreach my $partid (@{$prob->parts}) {
- $worksheet->write($partid_row,$cols_output,$partid);
+ $worksheet->write($partid_row,$cols_output,
+ $prob->part_display($partid));
my $responses = [$prob->responseIds($partid)];
my $resptypes = [$prob->responseType($partid)];
for (my $i=0;$i 5) {
- # progress window
- my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
- ($r,'Problem Analysis Status',
- 'Problem Analysis Progress',
- scalar(@$Problems),
- 'inline',undef,'Statistics','stats_status');
- foreach my $problem (@$Problems) {
- $Data{$problem->symb} =
- {&Apache::lonstathelpers::get_problem_data
- ($problem->src)};
- &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
- 'last problem');
- }
- &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
- } else {
- foreach my $problem (@$Problems) {
- $Data{$problem->symb} =
- {&Apache::lonstathelpers::get_problem_data
- ($problem->src)};
- }
- }
- return \%Data;
-}
-
-
-=pod
-
#########################################################
#########################################################
##
@@ -766,20 +724,8 @@ sub get_problem_data {
#########################################################
#########################################################
sub prepare_csv_output {
- my ($r,$Problems,$Students) = @_;
- my $problem;
- #
+ my ($r,$problems,$students) = @_;
my $c = $r->connection();
- my ($resource,$respid,$partid) = ($problem->{'resource'},
- $problem->{'respid'},
- $problem->{'part'});
- #
- if ($ENV{'form.correctans'} eq 'true') {
- $r->print('