Can send solutions on the backend (using the same file as frontend)
This commit is contained in:
parent
dbc97fda8a
commit
4a67552a29
2 changed files with 25 additions and 17 deletions
|
|
@ -41,18 +41,22 @@ if (isset($VAR['submission_dir']))
|
|||
{
|
||||
if (is_writable("$submission_dir/"))
|
||||
{
|
||||
$file = $submission_dir.'/'.$p[1].'-'.$p[2].'-'.$p[3];
|
||||
function show_submission_result($path)
|
||||
{
|
||||
header("Location: /".SALT_USER."/".$path);
|
||||
exit;
|
||||
}
|
||||
|
||||
file_put_contents($file, $_POST['solution'], LOCK_EX);
|
||||
$_GET["team"] = $p[1];
|
||||
$_GET["theme"] = $p[2];
|
||||
$_GET["exercice"] = $p[3];
|
||||
|
||||
header("Location: /".implode("/", $p));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: /".implode("/", $p)."/werr");
|
||||
exit;
|
||||
require("../submission.php");
|
||||
}
|
||||
|
||||
// Fallback error
|
||||
header("Location: /".implode("/", $p)."/werr");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue