X-Git-Url: http://git.treefish.org/banana.git/blobdiff_plain/8db41c98817b1b48532dc3cebf4bea166e42bb70..df32c63a6e9666eb062f806262aa23ed43c6eb99:/submit.php?ds=sidebyside
diff --git a/submit.php b/submit.php
index aabc3fe..d64b8da 100644
--- a/submit.php
+++ b/submit.php
@@ -5,7 +5,7 @@
if ( ! isset($SESSIONS_next) ) {
block("red", "submission closed");
- break;
+ exit;
}
if(isset($_POST['submit']) && $_POST['mnumber']!="") {
@@ -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 '
';
- print 'You already submitted results for this session |
---|
';
+ $db->query("DELETE FROM workdone WHERE mnumber = $mnumber AND session = $sessionid");
+ print '';
+ print 'deleted old submission |
---|
';
print '
';
- print "You can only submit your calculated examples once!";
- break;
}
$excount = count($exchecked);
- $donestring = implode(', ', $exchecked);
+ $donestring = implode(',', $exchecked);
$db->query("INSERT INTO workdone (mnumber,session,manydone,thisdone)
VALUES (\"$mnumber\", \"$sessionid\", \"$excount\", \"$donestring\")");
@@ -33,7 +32,7 @@
print '';
print 'submitted |
---|
';
print '
';
- break;
+ exit;
}
?>
@@ -48,7 +47,7 @@
Mat.nummer: | |
- Password: | |
+ Password: | |
|