public function getAction(Exercise $exercise, Paper $paper, User $user)
    {
        $this->assertHasPermission('OPEN', $exercise);

        if (!$this->isAdmin($paper->getExercise()) && $paper->getUser() !== $user) {
            // Only administrator or the User attached can see a Paper
            throw new AccessDeniedException();
        }

        return new JsonResponse($this->paperManager->serialize($paper));
    }
public function getAction(Exercise $exercise, Paper $paper, User $user)
    {
        $this->assertHasPermission('OPEN', $exercise);

        if (!$this->isAdmin($paper->getExercise()) && $paper->getUser() !== $user) {
            // Only administrator or the User attached can see a Paper
            throw new AccessDeniedException();
        }

        return new JsonResponse($this->paperManager->serialize($paper));
    }
public function getAction ( Exercise $ exercise , Paper $ paper , User $ user ) { $ this -> assertHasPermission ( 'OPEN' , $ exercise ) ; if ( ! $ this -> isAdmin ( $ paper -> getExercise ( ) ) && $ paper -> getUser ( ) !== $ user ) { // Only administrator or the User attached can see a Paper throw new AccessDeniedException ( ) ; } return new JsonResponse ( $ this -> paperManager -> serialize ( $ paper ) ) ; }
Returns one paper.
Also includes the complete definition and solution of each question
associated with the exercise.

@EXT\Route("/{id}", name="exercise_paper_get")
@EXT\Method("GET")
@EXT\ParamConverter("paper", class="UJMExoBundle:Attempt\Paper", options={"mapping": {"id": "uuid"}})
@EXT\ParamConverter("user", converter="current_user")

@param Exercise $exercise
@param Paper    $paper
@param User     $user

@return JsonResponse
Returns one paper . Also includes the complete definition and solution of each question associated with the exercise .