Example #1
0
 public function finishpaper(Paper $paper)
 {
     $this->paperManager->finishPaper($paper);
 }
 /**
  * Saves the score of a question that need manual correction.
  *
  * @EXT\Route("/papers/{id}/questions/{questionId}/score/{score}", name="exercise_save_score")
  * @EXT\Method("PUT")
  * @EXT\ParamConverter("question", class="UJMExoBundle:Question", options={"mapping": {"questionId": "id"}})
  *
  * @param Question $question
  * @param Paper    $paper
  * @param int      $score
  *
  * @return JsonResponse
  */
 public function saveScoreAction(Question $question, Paper $paper, $score)
 {
     $this->assertHasPermission('ADMINISTRATE', $paper->getExercise());
     $this->paperManager->recordScore($question, $paper, $score);
     return new JsonResponse($this->paperManager->exportPaper($paper, $this->isAdmin($paper->getExercise())), 200);
 }