Пример #1
0
 public function getQuestionAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $ajaxRes = array('success' => 0, 'info' => null);
     $request = $this->getRequest();
     $dataTId = $request->getParam('dataTId', null);
     $dataQid = $request->getParam('dataQid', null);
     if (!empty($dataTId) && !empty($dataQid)) {
         $core = new PR_Api_Core_TestClass();
         $ajaxRes['info'] = $core->getTestQuestionInfo($dataQid);
         $ajaxRes['success'] = 1;
     }
     $response = $this->getResponse();
     $response->clearAllHeaders()->clearBody();
     $ajaxRes = json_encode($ajaxRes);
     $response->setHeader('Content-type', 'application/json');
     $response->setHeader('Content-Length', strlen($ajaxRes), true)->setBody($ajaxRes);
 }