X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/4dd46d68b056c25dcbd6caac2cfd578136e64bd7..da4d58fd2fe170781a7810fb5265b4744ce636ed:/submit.php?ds=sidebyside
diff --git a/submit.php b/submit.php
index 2e88c85..b8e1d7e 100644
--- a/submit.php
+++ b/submit.php
@@ -1,33 +1,27 @@
$line) {
- $sessions[$line_num] = explode("\t",$line);
- }
-
- if ( strtotime("now") > strtotime(end($sessions)[0]) ) {
- print '
';
- print 'submission closed |
---|
';
- print '
';
- break;
+ if ( ! isset($SESSIONS_next) ) {
+ block("red", "submission closed");
+ exit;
}
if(isset($_POST['submit']) && $_POST['mnumber']!="") {
- require 'usercheck.inc';
-
+ require 'include/usercheck.inc';
+
$exchecked = $_POST['exchecked'];
$mnumber = $_POST['mnumber'];
- $sessionid = strtotime(end($sessions)[0]);
+ $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 |
---|
';
print '
';
print "You can only submit your calculated examples once!";
- break;
+ exit;
}
$excount = count($exchecked);
@@ -39,21 +33,14 @@
print '';
print 'submitted |
---|
';
print '
';
- break;
- }
-
- if(trim(end($sessions)[0]) == "") {
- print '';
- print 'no exercises defined |
---|
';
- print '
';
- break;
+ exit;
}
?>