--- loncom/interface/statistics/lonstudentsubmissions.pm 2005/02/03 00:25:01 1.33 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2005/03/14 22:38:29 1.38 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.33 2005/02/03 00:25:01 matthew Exp $ +# $Id: lonstudentsubmissions.pm,v 1.38 2005/03/14 22:38:29 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,6 +110,9 @@ sub BuildStudentSubmissionsPage { push(@Problems,$resource); } # + $r->print('
'.&mt("Unable to create new Excel file. ". - "This error has been logged. ". - "Please alert your LON-CAPA administrator"). - '
'); - return undef; - } - # - $workbook->set_tempdir('/home/httpd/perl/tmp'); - # - my $format = &Apache::loncommon::define_excel_formats($workbook); + my ($workbook,$filename,$format) = + &Apache::loncommon::create_workbook($r); + return if (! defined($workbook)); my $worksheet = $workbook->addworksheet('Student Submission Data'); # # Add headers to the worksheet @@ -655,7 +648,7 @@ sub prepare_excel_output { $worksheet->write($partid_row,0,'Part ID',$format->{'bold'}); $worksheet->write($respid_row,0,'Response ID',$format->{'bold'}); # Student headers - my @StudentColumns = ('username','domain','id'); + my @StudentColumns = ('username','domain','id','section'); foreach (@StudentColumns) { $worksheet->write($header_row,$cols_output++,ucfirst($_), $format->{'bold'}); @@ -756,14 +749,13 @@ sub prepare_excel_output { } } # Fill in the remaining rows with the students data - for (my $row = $student_row+1;$row<=$max_row;$row++) { + for (my $row = $student_row+1;$row<$max_row;$row++) { my $cols = 0; foreach my $field (@StudentColumns) { $worksheet->write($row,$cols++, $student->{$field}); } } - $rows_output++; &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, 'last student'); } @@ -900,7 +892,7 @@ sub prepare_csv_output { my @extra_resp_headers = &get_extra_response_headers(); # # Create the table header - my @student_columns = ('username','domain','id'); + my @student_columns = ('username','domain','id','section'); # my %headers; push(@{$headers{'student'}},@student_columns);