plugin->test_constructor_gatekeeper(); $id = get_input('id'); if ($id) { $assessment = $TeKe->plugin->loadType("assessment", $id); header("Content-type: text/csv;charset=utf-8"); header("Content-Disposition: attachment; filename=candidates.csv"); $csv_content_list = $assessment->getCandidatesTableCSV(); $filename = tempnam(sys_get_temp_dir(), "candidates.csv"); $csv_file = fopen($filename, "w"); foreach ($csv_content_list as $fields) { fputcsv($csv_file, $fields); } fclose($csv_file); $file_content = file_get_contents($filename); unlink($filename); echo $file_content; exit; } else { $TeKe->add_system_message(_("No action")); } ?>