Skip to content
Browse files

*** empty log message ***

  • Loading branch information...
1 parent fff91cc commit d8247a98d6f3ded77197dbc96dce0e23cfab6fc9 ecastrolt committed
Showing with 9 additions and 9 deletions.
  1. +9 −9 mod/quiz/report/analysis/report.php
View
18 mod/quiz/report/analysis/report.php
@@ -459,13 +459,17 @@ function Export_Excel(&$questions, $filename) {
header("Pragma: public");
header("Content-Transfer-Encoding: binary");
- $workbook = new Workbook($filename);
+ $workbook = new Workbook("-");
// Creating the first worksheet
$sheettitle = get_string('reportanalysis','quiz_analysis');
- $myxls = &$workbook->add_worksheet($sheettitle);
+ $myxls =& $workbook->add_worksheet($sheettitle);
/// format types
$format =& $workbook->add_format();
$format->set_bold(0);
+ $formatbc =& $workbook->add_format();
+ $formatbc->set_bold(1);
+ $formatb =& $workbook->add_format();
+ $formatb->set_bold(1);
$formaty =& $workbook->add_format();
$formaty->set_bg_color('yellow');
$formatyc =& $workbook->add_format();
@@ -474,10 +478,6 @@ function Export_Excel(&$questions, $filename) {
$formatyc->set_align('center');
$formatc =& $workbook->add_format();
$formatc->set_align('center');
- $formatb =& $workbook->add_format();
- $formatb->set_bold(1);
- $formatbc =& $workbook->add_format();
- $formatbc->set_bold(1);
$formatbc->set_align('center');
$formatbpct =& $workbook->add_format();
$formatbpct->set_bold(1);
@@ -493,8 +493,6 @@ function Export_Excel(&$questions, $filename) {
$formatblue->set_bold(1);
$formatblue->set_color('blue');
$formatblue->set_align('center');
- $myxls->write_string(0,0,format_string($quiz->name,true));
-
// Here starts workshhet headers
$myxls->write_string(0,0,$sheettitle,$formatb);
@@ -518,13 +516,14 @@ function Export_Excel(&$questions, $filename) {
foreach($rows as $rowdata){
$col = 0;
foreach($rowdata as $item){
- $myxls->write($row,$col,$item,0);
+ $myxls->write($row,$col,$item,$format);
$col++;
}
$row++;
}
}
$workbook->close();
+ exit;
}
@@ -571,6 +570,7 @@ function Export_OOo(&$questions, $filename) {
}
$sxw->Table($headers,$data);
$sxw->Output();
+ exit;
}
function Export_CSV(&$questions, $filename) {

0 comments on commit d8247a9

Please sign in to comment.
Something went wrong with that request. Please try again.