public function regenerateAction(Request $request)
    {
        /** @var UserSessionInterface $userSession */
        $userSession = $this->get('qcm_core.controller.user_session')->findOr404($request);
        $generator = $this->get('qcm_core.question.generator');

        $userSession->getConfiguration()->eraseQuestions();
        $generator->generate($userSession);

        $configuration = clone $userSession->getConfiguration();
        $userSession->setConfiguration($configuration);

        $manager = $this->getDoctrine()->getManager();
        $manager->persist($userSession);
        $manager->flush();

        return $this->redirect($this->generateUrl('qcm_admin_user_session_show', array(
            'id' => $userSession->getId()
        )));
    }