plugin/dropzone/Manager/CorrectionManager.php
public function calculateCorrectionTotalGrade(Dropzone $dropzone, Correction $correction)
    {
        $nbCriteria = count($dropzone->getPeerReviewCriteria());
        $maxGrade = $dropzone->getTotalCriteriaColumn() - 1;
        $sumGrades = 0;
        foreach ($correction->getGrades() as $grade) {
            ($grade->getValue() > $maxGrade) ? $sumGrades += $maxGrade : $sumGrades += $grade->getValue();
        }

        $totalGrade = 0;
        if (0 !== $nbCriteria) {
            $totalGrade = $sumGrades / ($nbCriteria);
            $totalGrade = ($totalGrade * 20) / ($maxGrade);
        }

        return $totalGrade;
    }
public function calculateCorrectionTotalGrade(Dropzone $dropzone, Correction $correction)
    {
        $nbCriteria = count($dropzone->getPeerReviewCriteria());
        $maxGrade = $dropzone->getTotalCriteriaColumn() - 1;
        $sumGrades = 0;
        foreach ($correction->getGrades() as $grade) {
            ($grade->getValue() > $maxGrade) ? $sumGrades += $maxGrade : $sumGrades += $grade->getValue();
        }

        $totalGrade = 0;
        if (0 !== $nbCriteria) {
            $totalGrade = $sumGrades / ($nbCriteria);
            $totalGrade = ($totalGrade * 20) / ($maxGrade);
        }

        return $totalGrade;
    }
public function calculateCorrectionTotalGrade ( Dropzone $ dropzone , Correction $ correction ) { $ nbCriteria = count ( $ dropzone -> getPeerReviewCriteria ( ) ) ; $ maxGrade = $ dropzone -> getTotalCriteriaColumn ( ) - 1 ; $ sumGrades = 0 ; foreach ( $ correction -> getGrades ( ) as $ grade ) { ( $ grade -> getValue ( ) > $ maxGrade ) ? $ sumGrades += $ maxGrade : $ sumGrades += $ grade -> getValue ( ) ; } $ totalGrade = 0 ; if ( 0 !== $ nbCriteria ) { $ totalGrade = $ sumGrades / ( $ nbCriteria ) ; $ totalGrade = ( $ totalGrade * 20 ) / ( $ maxGrade ) ; } return $ totalGrade ; }
Calculate the grad of a copy.

@param Dropzone   $dropzone
@param Correction $correction

@return float|int
Calculate the grad of a copy .