Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Commit ba3ea4b

Browse files
committed
Timeout module complete. Now proper messages are shown on a program exceeding a time limit.
1 parent 48b99b9 commit ba3ea4b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

eval.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
mysql_query($query);
7171
header("Location: solve.php?oerror=1&id=".$_POST['id']);
7272
}
73+
} else if($status == 2) {
74+
$query = "UPDATE solve SET status=1 WHERE (username='".$_SESSION['username']."' AND problem_id='".$_POST['id']."')";
75+
mysql_query($query);
76+
header("Location: solve.php?terror=1&id=".$_POST['id']);
7377
}
7478
} else
7579
header("Location: solve.php?serror=1&id=".$_POST['id']); // compiler server not running

solve.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
<div class="container">
2828
<?php
29+
if(isset($_GET['terror']))
30+
echo("<div class=\"alert alert-warning\">\nYour program exceeded the time limit. Maybe you should improve your algorithm.\n</div>");
2931
if(isset($_GET['cerror']))
3032
echo("<div class=\"alert alert-error\">\n<strong>The following errors occured:</strong><br/>\n<pre>\n".$_SESSION['cerror']."\n</pre>\n</div>");
3133
else if(isset($_GET['oerror']))

0 commit comments

Comments
 (0)