'.&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');
+ #
+ # Define some potentially useful formats
+ my $format;
+ $format->{'header'} = $workbook->add_format(bold => 1,
+ bottom => 1,
+# text_wrap => 1,
+ align => 'center');
+ $format->{'bold'} = $workbook->add_format(bold=>1);
+ $format->{'h1'} = $workbook->add_format(bold=>1, size=>18);
+ $format->{'h2'} = $workbook->add_format(bold=>1, size=>16);
+ $format->{'h3'} = $workbook->add_format(bold=>1, size=>14);
+ $format->{'date'} = $workbook->add_format(num_format=>
+ 'mmm d yyyy hh:mm AM/PM');
+ #
+ # Create and populate main worksheets
+ my $problem_data_sheet = $workbook->addworksheet('Problem Data');
+ my $student_data_sheet = $workbook->addworksheet('Student Data');
+ my $response_data_sheet = $workbook->addworksheet('Response Data');
+ foreach my $sheet ($problem_data_sheet,$student_data_sheet,
+ $response_data_sheet) {
+ $sheet->write(0,0,$resource->{'title'},$format->{'h2'});
+ $sheet->write(1,0,$resource->{'src'},$format->{'h3'});
+ }
+ #
+ my $result;
+ $result = &build_problem_data_worksheet($problem_data_sheet,$format,
+ $Concepts,$ORdata);
+ if ($result ne 'okay') {
+ # Do something useful
+ }
+ $result = &build_student_data_worksheet($student_data_sheet,$format);
+ if ($result ne 'okay') {
+ # Do something useful
+ }
+ $result = &build_response_data_worksheet($response_data_sheet,$format,
+ $PerformanceData,$Foils,
+ $ORdata);
+ if ($result ne 'okay') {
+ # Do something useful
+ }
+ $response_data_sheet->activate();
+ #
+ # Close the excel file
+ $workbook->close();
+ #
+ # Write a link to allow them to download it
+ $result .= ''."\n";
$Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
$Str .= ' | ';
@@ -282,7 +1158,7 @@ sub CreateInterface {
$Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
$Str .= '';
#
- $Str .= '';
+# $Str .= ' | ';
my $only_seq_with_assessments = sub {
my $s=shift;
if ($s->{'num_assess'} < 1) {
@@ -291,32 +1167,64 @@ sub CreateInterface {
return 1;
}
};
- $Str .= &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,
+ &Apache::lonstatistics::MapSelect('Maps','multiple,all',5,
$only_seq_with_assessments);
- $Str .= ' | ';
- #
+ ##
+ ##
$Str .= '';
- $Str .='';
- $Str .='';
+ $Str .= ' | ';
- #
+ ##
+ ##
$Str .= '
'."\n";
$Str .= '