function generarEstadisticas($ids) { $this->numeroTweetsPuntuados = count($ids); $this->numeroTweets = Grades::getNumberTweetsOfUserInGroup($this->alumno->id, $this->group->id); $notas = Grades::getNotaMediaYTotalofUserinGroup($this->alumno->id, $this->group->id); $this->notaMedia = number_format(reset($notas), 2); $this->notaTotal = number_format(key($notas), 2); if (empty($this->notaTotal)) { $this->notaTotal = number_format(0, 2); } }