private function sendFinishedLog(Drop $drop)
 {
     //        var_dump('sendFinishedLog');
     if ($drop != null) {
         //            var_dump('drop not null');
         if ($drop->getDropzone()->getPeerReview() === false or $drop->countFinishedCorrections() >= $drop->getDropzone()->getExpectedTotalCorrection()) {
             //                var_dump('pas de peer review ou bien assez de correction');
             $finished = false;
             if ($drop->getDropzone()->getPeerReview() === true) {
                 //                    var_dump('peer review. mais est ce que le user a corrigé assez de copie');
                 $nbCorrections = $this->entityManager->getRepository('IcapDropzoneBundle:Correction')->countFinished($drop->getDropzone(), $drop->getUser());
                 if ($nbCorrections >= $drop->getDropzone()->getExpectedTotalCorrection()) {
                     $finished = true;
                 }
             } else {
                 //                    var_dump('pas de peer review donc fini !');
                 $finished = true;
             }
             if ($finished === true) {
                 //                    var_dump('finish');
                 $grade = $drop->getCalculatedGrade();
                 $event = new LogDropEvaluateEvent($drop->getDropzone(), $drop, $grade);
                 $event->setDoer($drop->getUser());
                 //                    var_dump('finish grade = '.$grade);
                 $this->eventDispatcher->dispatch('log', $event);
             }
         }
     }
 }
 private function sendFinishedLog(Drop $drop)
 {
     if ($drop != null) {
         if ($drop->getDropzone()->getPeerReview() === false || $drop->countFinishedCorrections() >= $drop->getDropzone()->getExpectedTotalCorrection()) {
             $finished = false;
             if ($drop->getDropzone()->getPeerReview() === true) {
                 $nbCorrections = $this->entityManager->getRepository('IcapDropzoneBundle:Correction')->countFinished($drop->getDropzone(), $drop->getUser());
                 if ($nbCorrections >= $drop->getDropzone()->getExpectedTotalCorrection()) {
                     $finished = true;
                 }
             } else {
                 $finished = true;
             }
             if ($finished === true) {
                 $grade = $drop->getCalculatedGrade();
                 $event = new LogDropEvaluateEvent($drop->getDropzone(), $drop, $grade);
                 $event->setDoer($drop->getUser());
                 $this->eventDispatcher->dispatch('log', $event);
             }
         }
     }
 }