public function getPapersSuccessDistribution(Exercise $exercise, $scoreOn)
    {
        $papers = $this->paperRepository->findBy([
            'exercise' => $exercise,
        ]);

        $nbSuccess = 0;
        $nbMissed = 0;
        $nbPartialSuccess = 0;

        $scores = $this->getPapersScores($papers, $scoreOn);

        /* @var Paper $paper */
        foreach ($scores as $score) {
            if ($score === floatval(0)) {
                ++$nbMissed;
            } elseif ($score === floatval($scoreOn)) {
                ++$nbSuccess;
            } else {
                ++$nbPartialSuccess;
            }
        }

        return [
            'nbSuccess' => $nbSuccess,
            'nbMissed' => $nbMissed,
            'nbPartialSuccess' => $nbPartialSuccess,
        ];
    }
public function getPapersSuccessDistribution(Exercise $exercise, $scoreOn)
    {
        $papers = $this->paperRepository->findBy([
            'exercise' => $exercise,
        ]);

        $nbSuccess = 0;
        $nbMissed = 0;
        $nbPartialSuccess = 0;

        $scores = $this->getPapersScores($papers, $scoreOn);

        /* @var Paper $paper */
        foreach ($scores as $score) {
            if ($score === floatval(0)) {
                ++$nbMissed;
            } elseif ($score === floatval($scoreOn)) {
                ++$nbSuccess;
            } else {
                ++$nbPartialSuccess;
            }
        }

        return [
            'nbSuccess' => $nbSuccess,
            'nbMissed' => $nbMissed,
            'nbPartialSuccess' => $nbPartialSuccess,
        ];
    }
public function getPapersSuccessDistribution ( Exercise $ exercise , $ scoreOn ) { $ papers = $ this -> paperRepository -> findBy ( [ 'exercise' => $ exercise , ] ) ; $ nbSuccess = 0 ; $ nbMissed = 0 ; $ nbPartialSuccess = 0 ; $ scores = $ this -> getPapersScores ( $ papers , $ scoreOn ) ; /* @var Paper $paper */ foreach ( $ scores as $ score ) { if ( $ score === floatval ( 0 ) ) { ++ $ nbMissed ; } elseif ( $ score === floatval ( $ scoreOn ) ) { ++ $ nbSuccess ; } else { ++ $ nbPartialSuccess ; } } return [ 'nbSuccess' => $ nbSuccess , 'nbMissed' => $ nbMissed , 'nbPartialSuccess' => $ nbPartialSuccess , ] ; }
Returns the number of fully, partially successfull and missed papers for a given exercise.

@param Exercise $exercise
@param float    $scoreOn

@return array
Returns the number of fully partially successfull and missed papers for a given exercise .