diff --git a/onyx/include/team/summary.php b/onyx/include/team/summary.php index 4403c9ca..556a9298 100644 --- a/onyx/include/team/summary.php +++ b/onyx/include/team/summary.php @@ -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"; diff --git a/onyx/tpl/bootstrap/teams/me.tpl b/onyx/tpl/bootstrap/teams/me.tpl index bd05fbd7..7b73a58a 100644 --- a/onyx/tpl/bootstrap/teams/me.tpl +++ b/onyx/tpl/bootstrap/teams/me.tpl @@ -5,7 +5,7 @@