public function findScore(Paper $paper)
    {
        return (float) $this->getEntityManager()
            ->createQuery('
                SELECT SUM(a.score)
                FROM UJM\ExoBundle\Entity\Attempt\Answer AS a
                WHERE a.paper = :paper
                  AND a.score IS NOT NULL
            ')
            ->setParameters([
                'paper' => $paper,
            ])
            ->getSingleScalarResult();
    }
public function findScore(Paper $paper)
    {
        return (float) $this->getEntityManager()
            ->createQuery('
                SELECT SUM(a.score)
                FROM UJM\ExoBundle\Entity\Attempt\Answer AS a
                WHERE a.paper = :paper
                  AND a.score IS NOT NULL
            ')
            ->setParameters([
                'paper' => $paper,
            ])
            ->getSingleScalarResult();
    }
public function findScore ( Paper $ paper ) { return ( float ) $ this -> getEntityManager ( ) -> createQuery ( '
                SELECT SUM(a.score)
                FROM UJM\ExoBundle\Entity\Attempt\Answer AS a
                WHERE a.paper = :paper
                  AND a.score IS NOT NULL
            ' ) -> setParameters ( [ 'paper' => $ paper , ] ) -> getSingleScalarResult ( ) ; }
Finds the score of a paper by summing the score of each answer.

@param Paper $paper

@return float
Finds the score of a paper by summing the score of each answer .