ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.assAnswerTrueFalse.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 
22 {
31 
42  public function ASS_AnswerTrueFalse ( $answertext = "", $points = 0.0, $order = 0, $correctness = false )
43  {
45 
46  // force $this->correctness to be a string
47  // ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
48  // (maybe that only happens for certain mysql versions)
49  $this->correctness = $correctness."";
50  }
51 
57  public function getCorrectness()
58  {
59  return $this->correctness;
60  }
61 
67  public function isCorrect()
68  {
69  return $this->correctness;
70  }
71 
77  public function isIncorrect()
78  {
79  return !$this->correctness;
80  }
81 
89  public function isTrue()
90  {
91  return $this->correctness;
92  }
93 
101  public function isFalse()
102  {
103  return !$this->correctness;
104  }
105 
111  public function setCorrectness($correctness = FALSE)
112  {
113  // force $this->correctness to be a string
114  // ilDB->quote makes 1 from true and saving it to ENUM('1','0') makes that '0'!!!
115  // (maybe that only happens for certain mysql versions)
116  $this->correctness = $correctness."";
117  }
118 
124  public function setTrue()
125  {
126  $this->correctness = "1";
127  }
128 
134  public function setFalse()
135  {
136  $this->correctness = "0";
137  }
138 }