public function canPass(Exercise $exercise, User $user = null)
    {
        // TODO : max attempts by day

        $canPass = true;
        if ($user) {
            $max = $exercise->getMaxAttempts();
            if ($max > 0) {
                $nbFinishedPapers = $this->paperManager->countUserFinishedPapers($exercise, $user);
                if ($nbFinishedPapers >= $max) {
                    $canPass = false;
                }
            }
        }

        return $canPass;
    }