Count solved exercices
This commit is contained in:
parent
977cd67c8b
commit
05bc4c605c
1 changed files with 13 additions and 13 deletions
|
|
@ -216,25 +216,25 @@ class Team
|
||||||
|
|
||||||
function get_solved_exercices($id_theme=-1)
|
function get_solved_exercices($id_theme=-1)
|
||||||
{
|
{
|
||||||
|
$array = array();
|
||||||
|
global $db;
|
||||||
if ($id_theme != -1)
|
if ($id_theme != -1)
|
||||||
{
|
|
||||||
global $db;
|
|
||||||
$ids = $db->query("SELECT `id_theme`, `id_exercice`
|
$ids = $db->query("SELECT `id_theme`, `id_exercice`
|
||||||
FROM solved S
|
FROM solved S
|
||||||
LEFT OUTER JOIN exercices E ON S.id_exercice = E.id
|
LEFT OUTER JOIN exercices E ON S.id_exercice = E.id
|
||||||
WHERE id_team =".$this->id." AND id_theme =".$id_theme);
|
WHERE id_team =".$this->id." AND id_theme =".$id_theme);
|
||||||
|
else
|
||||||
$array = array();
|
$ids = $db->query("SELECT `id_theme`, `id_exercice`
|
||||||
$i = 0;
|
FROM solved S
|
||||||
if ($ids)
|
LEFT OUTER JOIN exercices E ON S.id_exercice = E.id
|
||||||
{
|
WHERE id_team =".$this->id);
|
||||||
foreach ($ids as $id)
|
if ($ids)
|
||||||
$array[] = new Exercice($id['id_exercice']);
|
{
|
||||||
}
|
foreach ($ids as $id)
|
||||||
|
$array[] = new Exercice($id['id_exercice']);
|
||||||
return $array;
|
|
||||||
}
|
}
|
||||||
return NULL;
|
|
||||||
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static methods
|
// Static methods
|
||||||
|
|
|
||||||
Reference in a new issue