Exemplo n.º 1
0
 /**
  * Увеличение индекса сортировка для вопроса (перемещение вниз в списке)
  * @return void
  */
 public function downAction()
 {
     if ($this->_authorize('question', 'down')) {
         $arrParams = $this->getRequest()->getParams();
         if (array_key_exists('questionId', $arrParams) && !empty($arrParams['questionId'])) {
             $questionId = (int) $arrParams['questionId'];
         } else {
             throw new Exception('[LS_REQUIRED_PARAM_FAILED]');
         }
         if (array_key_exists('testId', $arrParams) && !empty($arrParams['testId'])) {
             $testId = (int) $arrParams['testId'];
         } else {
             throw new Exception('[LS_REQUIRED_PARAM_FAILED]');
         }
         $objQuestions = new Questions();
         $objQuestions->moveQuestionDown($questionId, $testId);
         if (array_key_exists('testId', $arrParams) && !empty($arrParams['testId'])) {
             $this->_helper->redirector('edit', 'test', null, array('testId' => $testId));
         }
     }
 }