if (round($user_results[$i]['percent'], $percent_decimals) < $pass_mark) { echo '<Cell ss:StyleID="s25"><Data ss:Type="Number">' . MathsUtils::formatNumber($temp_percent, $percent_decimals) . '</Data></Cell>'; echo '<Cell ss:StyleID="s25"><Data ss:Type="String">' . $string['fail'] . '</Data></Cell>'; } else { if (round($user_results[$i]['percent'], $percent_decimals) >= $distinction_mark) { echo '<Cell ss:StyleID="s31"><Data ss:Type="Number">' . MathsUtils::formatNumber($temp_percent, $percent_decimals) . '</Data></Cell>'; echo '<Cell ss:StyleID="s31"><Data ss:Type="String">' . $string['distinction'] . '</Data></Cell>'; } else { echo '<Cell><Data ss:Type="Number">' . MathsUtils::formatNumber($temp_percent, $percent_decimals) . '</Data></Cell>'; echo '<Cell><Data ss:Type="String">' . $string['pass'] . '</Data></Cell>'; } } echo '<Cell><Data ss:Type="Number">' . $user_results[$i]['rank'] . '</Data></Cell>'; echo '<Cell><Data ss:Type="Number">' . $user_results[$i]['decile'] . '</Data></Cell>'; echo '<Cell><Data ss:Type="String">' . $user_results[$i]['display_started'] . '</Data></Cell>'; echo '<Cell><Data ss:Type="String">' . $report->formatsec($user_results[$i]['duration']) . '</Data></Cell>'; echo '<Cell><Data ss:Type="String">' . $user_results[$i]['ipaddress'] . '</Data></Cell>'; if ($paper_type == '2') { echo '<Cell><Data ss:Type="String">' . $user_results[$i]['room'] . '</Data></Cell>'; } // Display any associated metadata foreach ($metadata_cols as $key => $col) { echo '<Cell><Data ss:Type="String">' . $user_results[$i][$col] . '</Data></Cell>'; } echo '</Row>'; } } } echo ' </Table>'; echo ' <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">'; echo ' <Print>';
// Student did not take exam. $csv .= $user_results[$i]['student_grade'] . "," . $user_results[$i]['module'] . ",,,,No Attendance,,,,\n"; } else { // If room is unknown then it will contain HTML that we want to discard $user_results[$i]['room'] = strpos($user_results[$i]['room'], 'unknown') !== false ? 'unknown' : $user_results[$i]['room']; $csv .= $user_results[$i]['student_grade'] . ',"' . $user_results[$i]['module'] . '",' . $user_results[$i]['mark'] . ',' . MathsUtils::formatNumber($user_results[$i]['percent'], $percent_decimals) . '%,'; if (round($user_results[$i]['percent'], $percent_decimals) < $pass_mark) { $csv .= '"' . $string['fail'] . '",'; } else { if (round($user_results[$i]['percent'], $percent_decimals) >= $distinction_mark) { $csv .= '"' . $string['distinction'] . '",'; } else { $csv .= '"' . $string['pass'] . '",'; } } $csv .= $user_results[$i]['rank'] . ',' . $user_results[$i]['decile'] . ',' . $user_results[$i]['display_started'] . ',' . $report->formatsec($user_results[$i]['duration']) . ',' . $user_results[$i]['ipaddress'] . ',"' . $user_results[$i]['room'] . '"'; // Display any associated metadata if (count($metadata_cols) > 0) { foreach ($metadata_cols as $type) { $csv .= ',' . $user_results[$i][$type]; } } $csv .= "\n"; } } } $csv .= ",,,,,,,,,,,\n"; if ($cohort_size > 0) { $percent_failures = round($stats['failures'] / $cohort_size * 100); $percent_passes = round($stats['passes'] / $cohort_size * 100); $percent_honours = round($stats['honours'] / $cohort_size * 100);
echo "<td class=\"mk {$class} r {$role_css}\">"; if ($user_results[$i]['marking_complete'] == '0') { echo '<img src="../artwork/small_yellow_warning_icon.gif" width="12" height="11" alt="' . $string['markingnotcomplete'] . '" /> '; } echo $user_results[$i]['mark'] . "</td>"; echo "<td class=\"{$class} r {$role_css}\">" . MathsUtils::formatNumber($user_results[$i]['percent'], $percent_decimals) . "%</td><td class=\"{$class} {$role_css}\"> " . $string['pass'] . "</td>"; } } // Rank column echo "<td class=\"{$class} r {$role_css}\">" . $user_results[$i]['rank'] . "</td>"; // Decile column echo "<td class=\"{$class} r {$role_css}\">" . $user_results[$i]['decile'] . "</td>"; // Start Time column echo "<td class=\"{$class} {$role_css}\">" . $user_results[$i]['display_started'] . "</td>"; // Duration column echo "<td class=\"{$class} {$role_css}\">" . $report->formatsec($user_results[$i]['duration']); if ($late_submissions == 'y') { echo ' <img src="../artwork/small_yellow_warning_icon.gif" width="12" height="11" />'; } echo "</td>"; echo "<td class=\"{$class} {$role_css}\">" . $user_results[$i]['ipaddress'] . "</td>"; if ($paper_type == 2) { echo "<td class=\"{$class} {$role_css}\">" . $user_results[$i]['room'] . "</td>"; } // Display any associated metadata if (count($metadata_cols) > 0) { foreach ($metadata_cols as $type) { if (isset($user_results[$i][$type])) { echo "<td class=\"{$class} {$role_css}\"> " . $user_results[$i][$type] . "</td>"; } else { echo "<td class=\"{$class} {$role_css}\"> </td>";