$sessionid = $SESSIONS[$SESSIONS_next]['id'];
if($db->query("SELECT COUNT(*) FROM workdone WHERE mnumber = $mnumber AND session = $sessionid")->fetch(PDO::FETCH_NUM)[0] == 1) {
- print '<table bgcolor="red">';
- print '<tr><th><b><font color="white">You already submitted results for this session</font></b></th><tr>';
+ $db->query("DELETE FROM workdone WHERE mnumber = $mnumber AND session = $sessionid");
+ print '<table bgcolor="lightgreen">';
+ print '<tr><th><b><font color="white">deleted old submission</font></b></th><tr>';
print '</table>';
- print "You can only submit your calculated examples once!";
- exit;
}
$excount = count($exchecked);
- $donestring = implode(', ', $exchecked);
+ $donestring = implode(',', $exchecked);
$db->query("INSERT INTO workdone (mnumber,session,manydone,thisdone)
VALUES (\"$mnumber\", \"$sessionid\", \"$excount\", \"$donestring\")");