X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/78533c089d9413327f981cb2b20090a28f25e5e5..311a7991e63b57767d675dda37476a0cbd2bb0d8:/submit.php diff --git a/submit.php b/submit.php index b8e1d7e..d64b8da 100644 --- a/submit.php +++ b/submit.php @@ -17,15 +17,14 @@ $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\")"); @@ -48,7 +47,7 @@ <th align="left">Mat.nummer:</th> <th align="left"><input type="text" name="mnumber"></th> </tr> <tr> - <th align="left">Password:</th> <th align="left"><input type="text" name="password"></th> + <th align="left">Password:</th> <th align="left"><input type="password" name="password"></th> </tr> <tr><th colspan=2></th></tr>