server/onyx/include/team/exercice.php

37 lines
758 B
PHP
Raw Normal View History

2013-10-22 06:16:02 +00:00
<?php
if(!defined('ONYX')) exit;
2013-11-04 23:35:35 +00:00
try
{
$exercice = new Exercice($EXERCICE);
//TOP10
// $template->assign("top10", Team::get_top(10));
//
// //RANK
// $template->assign("my_team", new Team($TEAM));
//
// //BEGIN LISTING THEMES
// $template->assign("themes", Theme::get_themes());
2013-11-04 23:35:35 +00:00
if (!isset($exercice->id))
return "404";
2013-10-22 06:16:02 +00:00
2013-11-04 23:35:35 +00:00
if (!isset($exercice->theme) || $exercice->theme->name != $THEME)
return "404";
$solved = count($exercice->get_solved());
$template->assign("Exercice", $exercice);
$template->assign("team", $TEAM);
2013-11-04 23:35:35 +00:00
$template->assign("solved", $solved);
$template->assign("files", $exercice->files);
2013-11-04 23:35:35 +00:00
return "teams/exercice";
}
catch(Exception $e)
{
return "404";
}