diff --git a/onyx/include/common/Team.class.php b/onyx/include/common/Team.class.php index b299cf03..89830b7f 100644 --- a/onyx/include/common/Team.class.php +++ b/onyx/include/common/Team.class.php @@ -216,25 +216,25 @@ class Team function get_solved_exercices($id_theme=-1) { + $array = array(); + global $db; if ($id_theme != -1) - { - global $db; $ids = $db->query("SELECT `id_theme`, `id_exercice` FROM solved S LEFT OUTER JOIN exercices E ON S.id_exercice = E.id WHERE id_team =".$this->id." AND id_theme =".$id_theme); - - $array = array(); - $i = 0; - if ($ids) - { - foreach ($ids as $id) - $array[] = new Exercice($id['id_exercice']); - } - - return $array; + else + $ids = $db->query("SELECT `id_theme`, `id_exercice` + FROM solved S + LEFT OUTER JOIN exercices E ON S.id_exercice = E.id + WHERE id_team =".$this->id); + if ($ids) + { + foreach ($ids as $id) + $array[] = new Exercice($id['id_exercice']); } - return NULL; + + return $array; } // Static methods