Add progress bar in the me page
Fixed class panel-body name in the me.tpl
This commit is contained in:
parent
b406ae93e3
commit
4f2dbf5470
3 changed files with 31 additions and 1 deletions
|
|
@ -2,7 +2,22 @@
|
|||
|
||||
if(!defined('ONYX')) exit;
|
||||
|
||||
$themes = Theme::get_themes();
|
||||
if (!empty($themes))
|
||||
{
|
||||
$max_exo = 0;
|
||||
$res_exo = 0;
|
||||
foreach($themes as $th)
|
||||
{
|
||||
$max_exo += $th->get_nb_exercices();
|
||||
//$res_exo += $TEAM->get_nb_res_exercices_by_theme($th->get_id());
|
||||
$res_exo += count($TEAM->get_solved_exercices($th->get_id()));
|
||||
}
|
||||
$percent = $res_exo * 100 / $max_exo;
|
||||
}
|
||||
|
||||
$template->assign("themes", Theme::get_themes());
|
||||
$template->assign("nbExoMax", Exercice::get_nb_exo_max());
|
||||
$template->assign("percent", $percent);
|
||||
|
||||
return "teams/summary";
|
||||
|
|
|
|||
Reference in a new issue