/** * Test to detect the special case where the peerReview end whereas user didnt had time to make the expected * number of correction. * * @param Dropzone $dropzone * @param $nbCorrection * @return bool */ public function isPeerReviewEndedOrManualStateFinished(Dropzone $dropzone, $nbCorrection) { $specialCase = false; if ($dropzone->getManualPlanning() && $dropzone->getManualState() == Dropzone::MANUAL_STATE_FINISHED || !$dropzone->getManualPlanning() && $dropzone->getTimeRemaining($dropzone->getEndReview()) <= 0) { if ($dropzone->getExpectedTotalCorrection() > $nbCorrection) { $specialCase = true; } } return $specialCase; }