if (round($total_mark / $paper_total * 100) < $pass_mark) { $checked = ' checked'; } } if (round($total_mark / $paper_total * 100) < $pass_mark) { echo "<tr style=\"color:#C00000\"><td class=\"pad\"><input type=\"checkbox\" class=\"check\" name=\"student{$student_no}\" value=\"{$recordID}\"{$checked} /></td><td>{$username}</td><td>{$student_id}</td><td style=\"text-align:right\">{$total_mark}</td><td class=\"pad\">" . MathsUtils::formatNumber($total_mark / $paper_total * 100, $percent_decimals) . "%</td><td> </td></tr>\n"; } else { echo "<tr><td class=\"pad\"><input type=\"checkbox\" class=\"check\" name=\"student{$student_no}\" value=\"{$recordID}\"{$checked} /></td><td>{$username}</td><td>{$student_id}</td><td style=\"text-align:right\">{$total_mark}</td><td class=\"pad\">" . MathsUtils::formatNumber($total_mark / $paper_total * 100, $percent_decimals) . "%</td><td> </td></tr>\n"; } } ?> </table> <?php if ($student_no == 0) { $msg = sprintf($string['noattempts'], textbox_marking_utils::nicedate($startdate), textbox_marking_utils::nicedate($enddate)); echo $notice->info_strip($msg, 100); } else { ?> <br /> <input type="hidden" name="student_no" value="<?php echo $student_no; ?> " /> <input type="submit" name="submit" value="<?php echo $string['secondmark']; ?> " class="ok" style="margin-left:40px" /><input type="submit" name="submit" value="<?php echo $string['cancel']; ?> " class="cancel" />
$candidate_no = 0; if ($paper_type == '0' or $paper_type == '1' or $paper_type == '2') { // Get how many students took the paper. $result = $mysqli->prepare("SELECT DISTINCT lm.userID FROM log_metadata lm INNER JOIN users u ON lm.userID = u.id WHERE lm.paperID = ? AND DATE_ADD(lm.started, INTERVAL 2 MINUTE) >= ? AND lm.started <= ? AND (u.roles LIKE '%Student%' OR u.roles = 'graduate')"); $result->bind_param('iss', $paperID, $startdate, $enddate); $result->execute(); $result->bind_result($tmp_userID); while ($result->fetch()) { $candidate_no++; } $result->close(); } $second_mark = array(); if (isset($_GET['phase']) and $_GET['phase'] == 2) { // Get the usernames of papers to second mark. $second_mark = textbox_marking_utils::get_remark_users($paperID, $mysqli); } $phase_description = ''; if (!isset($_GET['phase'])) { $phase_description .= $string['finalisemarks']; $tmp_phase = ''; } elseif ($_GET['phase'] == 1) { $phase_description .= $string['primarymarking']; $tmp_phase = '&phase=1'; } elseif ($_GET['phase'] == 2) { $phase_description .= $string['secondmarking']; $tmp_phase = '&phase=2'; } $out_of = (isset($_GET['phase']) and $_GET['phase'] == 2) ? count($second_mark) : $candidate_no; if ($candidate_no > 0) { $phase_description .= ": " . number_format($out_of) . " " . $string['candidates'];