diff --git a/main/tracking/lp_results_by_user.php b/main/tracking/lp_results_by_user.php index 5ab5a95b5b..c171ddb9f8 100644 --- a/main/tracking/lp_results_by_user.php +++ b/main/tracking/lp_results_by_user.php @@ -80,7 +80,7 @@ if (!$export_to_xls) { echo '
'; if ($global) { - echo '
 '.get_lang('ExportAsXLS').'' . + echo '
 '.get_lang('ExportAsCSV').'' . ' '.get_lang('Print').'
'; $menu_items[] = ''.get_lang('TeacherInterface').''; @@ -212,18 +212,24 @@ if ($export_to_xls) { } function export_complete_report_xls($filename, $array) { - global $charset, $global, $filter_score; + require_once api_get_path(LIBRARY_PATH).'export.lib.inc.php'; + $header[] = array(get_lang('Course'),get_lang('LearningPath'), get_lang('Exercise'), get_lang('User'),get_lang('Attempt'), get_lang('Date'),get_lang('Results')); + if (!empty($array)) { + $array = array_merge($header, $array); + Export :: export_table_csv($array, 'reporting_learning_path_details'); + } + exit; + /* + global $global, $filter_score; $workbook = new Spreadsheet_Excel_Writer(); $workbook ->setTempDir(api_get_path(SYS_ARCHIVE_PATH)); $workbook->send($filename); $workbook->setVersion(8); // BIFF8 $worksheet =& $workbook->addWorksheet('Report'); - //$worksheet->setInputEncoding(api_get_system_encoding()); - $worksheet->setInputEncoding($charset); + $worksheet->setInputEncoding(api_get_system_encoding()); $line = 0; - $column = 0; //skip the first column (row titles) - + $column = 0; //skip the first column (row titles) $worksheet->write($line,$column,get_lang('Course')); $column++; @@ -251,6 +257,6 @@ function export_complete_report_xls($filename, $array) { $line++; $workbook->close(); - exit; + exit;*/ } Display :: display_footer(); \ No newline at end of file