Exercice page done with submission and confirmation
This commit is contained in:
parent
42c31a9315
commit
0f18ed8dcf
7 changed files with 60 additions and 5 deletions
|
|
@ -28,7 +28,7 @@ class Exercice
|
|||
|
||||
if (!empty($res))
|
||||
{
|
||||
$this->files = $db->query("SELECT `id`, `path`, `name`
|
||||
$this->files = $db->query("SELECT `id`, `path`, `name`, `sha1`
|
||||
FROM exercice_files
|
||||
WHERE id_exercice = '$id'");
|
||||
$this->keys = $db->query("SELECT `id`, `format`, `value`
|
||||
|
|
|
|||
5
onyx/include/team/confirmation.php
Normal file
5
onyx/include/team/confirmation.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
return "teams/confirmation";
|
||||
|
|
@ -15,7 +15,9 @@ try
|
|||
$solved = count($exercice->get_solved());
|
||||
|
||||
$template->assign("Exercice", $exercice);
|
||||
$template->assign("team", $TEAM);
|
||||
$template->assign("solved", $solved);
|
||||
$template->assign("files", $exercice->files);
|
||||
|
||||
return "teams/exercice";
|
||||
}
|
||||
|
|
|
|||
11
onyx/include/team/submission.php
Normal file
11
onyx/include/team/submission.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
$file = ONYX . "../submission/".$p[1]."-".$p[2]."-".$p[3];
|
||||
|
||||
file_put_contents($file, $_POST['solution'], LOCK_EX);
|
||||
|
||||
header('Location: /connected/'.$p[1].'/confirmation');
|
||||
|
||||
exit;
|
||||
Reference in a new issue