Пример #1
0
 public function doAddQuestionAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $ajaxRes = array('success' => 0, 'info' => null);
     $params = $this->getRequest()->getParams();
     $qstName = $params['qstName'];
     //$qstOpt = $params['qstOpt'];
     $qstListID = $params['qstListID'];
     $qasList = $params['qasList'];
     $dataTId = $params['dataTId'];
     $dataQid = $params['dataQid'];
     /*echo "<pre>";
           print_r($params);
       echo "</pre>"; die();*/
     if ($dataTId > 0 && !empty($qstName)) {
         $core = new PR_Api_Core_TestClass();
         //$core->updateQuestion($dataQid,$qstName,$qstOpt);
         $core->updateQuestion($dataQid, $qstName, $qasList, $qstListID);
         $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);
 }