1<?php 2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */ 3 4 5/** 6 * @author Björn Heyser <bheyser@databay.de> 7 * @version $Id$ 8 * 9 * @package Modules/Test 10 */ 11class ilTestDynamicQuestionSetFilterSelection 12{ 13 const ANSWER_STATUS_FILTER_VALUE_ALL_NON_CORRECT = 'allNonCorrect'; 14 const ANSWER_STATUS_FILTER_VALUE_NON_ANSWERED = 'nonAnswered'; 15 const ANSWER_STATUS_FILTER_VALUE_WRONG_ANSWERED = 'wrongAnswered'; 16 17 /** 18 * @var integer 19 */ 20 private $answerStatusActiveId = null; 21 22 /** 23 * @var string 24 */ 25 private $answerStatusSelection = null; 26 27 /** 28 * @var array 29 */ 30 private $taxonomySelection = array(); 31 32 /** 33 * @var array 34 */ 35 private $forcedQuestionIds = array(); 36 37 /** 38 * @param int $answerStatusActiveId 39 */ 40 public function setAnswerStatusActiveId($answerStatusActiveId) 41 { 42 $this->answerStatusActiveId = $answerStatusActiveId; 43 } 44 45 /** 46 * @return int 47 */ 48 public function getAnswerStatusActiveId() 49 { 50 return $this->answerStatusActiveId; 51 } 52 53 /** 54 * @param null $answerStatusSelection 55 */ 56 public function setAnswerStatusSelection($answerStatusSelection) 57 { 58 $this->answerStatusSelection = $answerStatusSelection; 59 } 60 61 /** 62 * @return null 63 */ 64 public function getAnswerStatusSelection() 65 { 66 return $this->answerStatusSelection; 67 } 68 69 /** 70 * @return bool 71 */ 72 public function hasAnswerStatusSelection() 73 { 74 switch ($this->getAnswerStatusSelection()) { 75 case self::ANSWER_STATUS_FILTER_VALUE_ALL_NON_CORRECT: 76 case self::ANSWER_STATUS_FILTER_VALUE_NON_ANSWERED: 77 case self::ANSWER_STATUS_FILTER_VALUE_WRONG_ANSWERED: 78 79 return true; 80 } 81 82 return false; 83 } 84 85 public function isAnswerStatusSelectionWrongAnswered() 86 { 87 return $this->getAnswerStatusSelection() == self::ANSWER_STATUS_FILTER_VALUE_WRONG_ANSWERED; 88 } 89 90 /** 91 * @param array $taxonomySelection 92 */ 93 public function setTaxonomySelection($taxonomySelection) 94 { 95 $this->taxonomySelection = $taxonomySelection; 96 } 97 98 /** 99 * @return array 100 */ 101 public function getTaxonomySelection() 102 { 103 return $this->taxonomySelection; 104 } 105 106 /** 107 * @param $taxonomyId 108 * @return bool 109 */ 110 public function hasSelectedTaxonomy($taxonomyId) 111 { 112 return isset($this->taxonomySelection[$taxonomyId]); 113 } 114 115 /** 116 * @param integer $taxonomyId 117 * @return array 118 */ 119 public function getSelectedTaxonomy($taxonomyId) 120 { 121 return $this->taxonomySelection[$taxonomyId]; 122 } 123 124 /** 125 * @param array $forcedQuestionIds 126 */ 127 public function setForcedQuestionIds($forcedQuestionIds) 128 { 129 $this->forcedQuestionIds = $forcedQuestionIds; 130 } 131 132 /** 133 * @return array 134 */ 135 public function getForcedQuestionIds() 136 { 137 return $this->forcedQuestionIds; 138 } 139} 140