} echo "<div class=\"page_title\">{$report_title}</div>\n"; echo "</div>\n"; // Output table header echo "<table id=\"maindata\" class=\"header tablesorter\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:100%\">\n"; echo "<thead>\n"; if (isset($user_results[0])) { echo "<tr>\n"; foreach ($table_order as $display => $col_width) { echo "<th style=\"width:" . $col_width . "px\" class=\"vert_div\">{$display}</th>\n"; } echo "</tr>\n"; } echo "</thead>\n<tbody>"; if ($user_no == 0) { $msg = sprintf($string['noattempts'], $report->nicedate($startdate), $report->nicedate($enddate)); echo "</tbody>\n</table>\n" . $notice->info_strip($msg) . "\n</div>\n</body>\n</html>"; exit; } for ($i = 0; $i < $user_no; $i++) { if ($user_results[$i]['started'] == '') { // No attendance echo "<tr class=\"nonattend\" onclick=\"popMenu(3, event); setVars('', '" . $user_results[$i]['userID'] . "');\"><td> </td><td>" . $user_results[$i]['title'] . "</td><td>" . $user_results[$i]['surname'] . "</td><td>" . $user_results[$i]['first_names'] . "</td><td>" . $user_results[$i]['student_id'] . "</td><td colspan=\"" . ($column_no - 2) . "\" style=\"text-align:center\"><" . $string['noattendance'] . "></td></tr>\n"; } else { echo "<tr onclick=\"popMenu(3, event); setVars('" . $user_results[$i]['metadataID'] . "', '" . $user_results[$i]['userID'] . "');\">\n"; echo "<td class=\"greyln\"><img src=\"../artwork/osce_16.gif\" class=\"picon\" /></td>"; echo '<td class="greyln col">' . $user_results[$i]['title'] . '</td>'; echo '<td class="greyln col">' . $user_results[$i]['surname'] . '</td>'; echo '<td class="greyln col">' . $user_results[$i]['first_names'] . '</td>'; echo '<td class="greyln col">' . $user_results[$i]['student_id'] . '</td>'; echo '<td class="greyln col">' . $user_results[$i]['grade'] . '</td>';
} $size_msg = $cohort_size < $user_no ? $cohort_size . $string['of'] . $user_no : $user_no; $csv .= $string['cohortsize'] . ",{$size_msg},,,,,,,,,,\n"; $csv .= $string['failureno'] . "," . $stats['failures'] . ",(" . round($percent_failures) . "% of cohort),,,,,,,,,\n"; $csv .= $string['passno'] . "," . $stats['passes'] . ",(" . round($percent_passes) . $string['percentofcohort'] . "),,,,,,,,,\n"; if (isset($ss_hon)) { $csv .= $string['distinctionno'] . "," . $stats['honours'] . ",(" . round($percent_honours) . "% of cohort),,,,,,,,,\n"; } $csv .= $string['totalmarks'] . "," . $report->get_total_marks() . ",,,,,,,,,,\n"; $csv .= $string['passmark'] . ",{$pass_mark}%,,,,,,,,,,\n"; if ($marking == '1') { $csv .= $string['randommark'] . "," . number_format($report->get_total_random_mark(), 2, '.', ',') . ",,,,,,,,,,\n"; } elseif (substr($marking, 0, 1) == '2') { $csv .= $string['ss'] . "," . round($report->get_ss_pass(), 2) . ",,,,,,,,,,\n"; $csv .= $string['ssdistinction'] . "," . round($report->get_ss_hon(), 2) . ",,,,,,,,,,\n"; } $csv .= $string['meanmark'] . "," . round($stats['mean_mark'], 1) . "," . MathsUtils::formatNumber($stats['mean_percent'], 1) . "%,,,,,,,,,\n"; $csv .= $string['medianmark'] . "," . round($stats['median_mark'], 1) . "," . MathsUtils::formatNumber($stats['median_percent'], 1) . "%,,,,,,,,,\n"; $csv .= $string['stdevmark'] . "," . number_format($stats['stddev_mark'], 2, '.', ',') . "," . MathsUtils::formatNumber($stats['stddev_percent'], 2) . "%,,,,,,,,,\n"; $csv .= $string['maxmark'] . "," . $stats['max_mark'] . "," . number_format($stats['max_percent']) . "%,,,,,,,,,\n"; $csv .= $string['maxmark'] . "," . $stats['min_mark'] . "," . number_format($stats['min_percent']) . "%,,,,,,,,,\n"; $csv .= $string['range'] . "," . $stats['range'] . "," . $stats['range_percent'] . "%,,,,,,,,,\n"; $avg_time = $stats['completed_no'] > 0 ? $report->formatsec(round($stats['total_time'] / $stats['completed_no'], 0)) : 'n/a'; $csv .= $string['averagetime'] . "," . $avg_time . ",,,,,,,,,,\n"; $csv .= $string['excludedquestions'] . "," . $report->get_display_excluded() . ",,,,,,,,,,\n"; $csv .= $string['skippedquestions'] . "," . $report->get_display_experimental() . ",,,,,,,,,,\n"; } else { $csv .= strip_tags(sprintf($string['noattempts'], $report->nicedate($startdate), $report->nicedate($enddate))); } echo mb_convert_encoding($csv, "UTF-16LE", "UTF-8"); $mysqli->close();