/**
  * request received to ask remote server for a shared secret
  *
  * @return \OC_OCS_Result
  */
 public function receiveSurveyResults()
 {
     $data = $this->request->getParam('data');
     $array = json_decode($data, true);
     if ($array === null) {
         return new \OC_OCS_Result(null, Http::STATUS_BAD_REQUEST, 'Invalid data supplied.');
     }
     try {
         $this->service->add($array);
     } catch (\Exception $e) {
         return new \OC_OCS_Result(null, Http::STATUS_BAD_REQUEST, 'Invalid data supplied.');
     }
     return new \OC_OCS_Result(null, Http::STATUS_OK);
 }
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  */
 public function index()
 {
     $statistics = $this->service->get();
     return new TemplateResponse('popularitycontestserver', 'main', $statistics);
 }