コード例 #1
0
 public static function getCookie()
 {
     if (self::$_post == null) {
         self::$_cookie = self::clear($_COOKIE);
     }
     return self::$_cookie;
 }
コード例 #2
0
 private function getPostQuestionModel($quizId, $questionId)
 {
     $questionMapper = new WpProQuiz_Model_QuestionMapper();
     $post = WpProQuiz_Controller_Request::getPost();
     $post['id'] = $questionId;
     $post['quizId'] = $quizId;
     $post['title'] = isset($post['title']) ? trim($post['title']) : '';
     $clearPost = $this->clearPost($post);
     $post['answerData'] = $clearPost['answerData'];
     if (empty($post['title'])) {
         $count = $questionMapper->count($quizId);
         $post['title'] = sprintf(__('Question: %d', 'wp-pro-quiz'), $count + 1);
     }
     if ($post['answerType'] === 'assessment_answer') {
         $post['answerPointsActivated'] = 1;
     }
     if (isset($post['answerPointsActivated'])) {
         if (isset($post['answerPointsDiffModusActivated'])) {
             $post['points'] = $clearPost['maxPoints'];
         } else {
             $post['points'] = $clearPost['points'];
         }
     }
     $post['categoryId'] = $post['category'] > 0 ? $post['category'] : 0;
     return new WpProQuiz_Model_Question($post);
 }