X-Git-Url: https://git.treefish.org/banana.git/blobdiff_plain/4678f209fb04682d0981cadb566d63f5726f9e09..8db41c98817b1b48532dc3cebf4bea166e42bb70:/submit.php
diff --git a/submit.php b/submit.php
index 2e88c85..aabc3fe 100644
--- a/submit.php
+++ b/submit.php
@@ -1,26 +1,20 @@
$line) {
- $sessions[$line_num] = explode("\t",$line);
- }
-
- if ( strtotime("now") > strtotime(end($sessions)[0]) ) {
- print '
';
- print 'submission closed |
---|
';
- print '
';
+ if ( ! isset($SESSIONS_next) ) {
+ block("red", "submission closed");
break;
}
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 '';
@@ -42,18 +36,11 @@
break;
}
- if(trim(end($sessions)[0]) == "") {
- print '';
- print 'no exercises defined |
---|
';
- print '
';
- break;
- }
-
?>