public function getMarks(Result $result, User $user, $canEdit)
    {
        $repo = $this->om->getRepository('ClarolineResultBundle:Mark');

        return $canEdit ?
            $repo->findByResult($result) :
            $repo->findByResultAndUser($result, $user);
    }