/**
  * @Route("/session/result/{id}", name="session_result", requirements={"id": "\d+"})
  */
 public function resultAction(Request $request, Session $session)
 {
     $manager = $this->getDoctrine()->getManager();
     $questions = $session->getQuestions();
     $radios = array();
     $texts = array();
     foreach ($questions as $question) {
         if ($question->getScale()->getType() == 'radio') {
             $radios[] = $question;
         } else {
             if ($question->getScale()->getType() == 'text') {
                 $texts['questionTable' . $question->getId()] = $question;
             }
         }
     }
     $resultService = new Results($manager);
     $charts = $resultService->getSimplyCharts($session, $radios);
     return $this->render('SurveyBundle:session:result.html.twig', array('charts' => $charts, 'session' => $session, 'texts' => $texts));
 }