ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.assAnswerBinaryState.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once './Modules/TestQuestionPool/classes/class.assAnswerSimple.php';
5 require_once './Modules/Test/classes/inc.AssessmentConstants.php';
6 
27 {
35  protected $state;
36 
50  public function __construct($answertext = "", $points = 0.0, $order = 0, $state = 0, $id = -1)
51  {
52  parent::__construct($answertext, $points, $order, $id);
53  $this->state = $state;
54  }
55 
64  public function getState()
65  {
66  return $this->state;
67  }
68 
77  public function isStateChecked()
78  {
79  return $this->state;
80  }
81 
90  public function isStateSet()
91  {
92  return $this->state;
93  }
94 
103  public function isStateUnset()
104  {
105  return !$this->state;
106  }
107 
116  public function isStateUnchecked()
117  {
118  return !$this->state;
119  }
120 
130  public function setState($state = 0)
131  {
132  $this->state = $state;
133  }
134 
142  public function setChecked()
143  {
144  $this->state = 1;
145  }
146 
154  public function setSet()
155  {
156  $this->state = 1;
157  }
158 
166  public function setUnset()
167  {
168  $this->state = 0;
169  }
170 
178  public function setUnchecked()
179  {
180  $this->state = 0;
181  }
182 }
setUnchecked()
Sets the answer as a unchecked answer.
setChecked()
Sets the answer as a checked answer.
__construct($answertext="", $points=0.0, $order=0, $state=0, $id=-1)
ASS_AnswerBinaryState constructor.
setState($state=0)
Sets the state.
Class for simple answers.
setUnset()
Sets the answer as a unset answer.
setSet()
Sets the answer as a set answer.
Class for true/false or yes/no answers.