Skip to content

Commit

Permalink
Merge branch 'MDL-34336-master' of git://github.com/ankitagarwal/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Aparup Banerjee committed Aug 13, 2012
2 parents 93d73cd + 0253b26 commit e9b5490
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions mod/scorm/report/interactions/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,9 @@ function display($scorm, $cm, $course, $download) {
}
$rownum = 1;
} else if ($download == 'CSV') {
$filename .= ".txt";
header("Content-Type: application/download\n");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Expires: 0");
header("Cache-Control: must-revalidate,post-check=0,pre-check=0");
header("Pragma: public");
echo implode("\t", $headers)." \n";
$csvexport = new csv_export_writer("tab");
$csvexport->set_filename($filename, ".txt");
$csvexport->add_data($headers);
}

if (!$download) {
Expand Down Expand Up @@ -546,8 +542,7 @@ function display($scorm, $cm, $course, $download) {
}
$rownum++;
} else if ($download == 'CSV') {
$text = implode("\t", $row);
echo $text." \n";
$csvexport->add_data($row);
}
}
if (!$download) {
Expand Down Expand Up @@ -606,6 +601,7 @@ function display($scorm, $cm, $course, $download) {
$workbook->close();
exit;
} else if ($download == 'CSV') {
$csvexport->download_file();
exit;
}
} else {
Expand Down

0 comments on commit e9b5490

Please sign in to comment.