plugin/drop-zone/Manager/DropzoneManager.php
public function computeDropScore(Drop $drop)
    {
        $corrections = $drop->getCorrections();
        $score = 0;
        $nbValidCorrection = 0;

        foreach ($corrections as $correction) {
            if ($correction->isFinished() && $correction->isValid()) {
                $score += $correction->getScore();
                ++$nbValidCorrection;
            }
        }
        $score = $nbValidCorrection > 0 ? round($score / $nbValidCorrection, 2) : null;
        $drop->setScore($score);
        $this->om->persist($drop);
        $this->om->flush();

        return $drop;
    }
public function computeDropScore(Drop $drop)
    {
        $corrections = $drop->getCorrections();
        $score = 0;
        $nbValidCorrection = 0;

        foreach ($corrections as $correction) {
            if ($correction->isFinished() && $correction->isValid()) {
                $score += $correction->getScore();
                ++$nbValidCorrection;
            }
        }
        $score = $nbValidCorrection > 0 ? round($score / $nbValidCorrection, 2) : null;
        $drop->setScore($score);
        $this->om->persist($drop);
        $this->om->flush();

        return $drop;
    }
public function computeDropScore ( Drop $ drop ) { $ corrections = $ drop -> getCorrections ( ) ; $ score = 0 ; $ nbValidCorrection = 0 ; foreach ( $ corrections as $ correction ) { if ( $ correction -> isFinished ( ) && $ correction -> isValid ( ) ) { $ score += $ correction -> getScore ( ) ; ++ $ nbValidCorrection ; } } $ score = $ nbValidCorrection > 0 ? round ( $ score / $ nbValidCorrection , 2 ) : null ; $ drop -> setScore ( $ score ) ; $ this -> om -> persist ( $ drop ) ; $ this -> om -> flush ( ) ; return $ drop ; }
Computes Drop score from submitted Corrections.

@param Drop $drop

@return Drop
Computes Drop score from submitted Corrections .