ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilQTIResponseVar.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
30 {
31  public const RESPONSEVAR_EQUAL = "1";
32  public const RESPONSEVAR_LT = "2";
33  public const RESPONSEVAR_LTE = "3";
34  public const RESPONSEVAR_GT = "4";
35  public const RESPONSEVAR_GTE = "5";
36  public const RESPONSEVAR_SUBSET = "6";
37  public const RESPONSEVAR_INSIDE = "7";
38  public const RESPONSEVAR_SUBSTRING = "8";
39 
40  public const CASE_YES = "1";
41  public const CASE_NO = "2";
42 
43  public const SETMATCH_PARTIAL = "1";
44  public const SETMATCH_EXACT = "2";
45 
46  public const AREATYPE_ELLIPSE = "1";
47  public const AREATYPE_RECTANGLE = "2";
48  public const AREATYPE_BOUNDED = "3";
49 
50  public string $vartype = '';
51  public ?string $case = null;
52  public ?string $respident = null;
53  public ?string $index = null;
54  public ?string $setmatch = null;
55  public ?string $areatype = null;
56  public ?string $content = null;
57 
58  public function __construct(string $a_vartype)
59  {
60  $this->setVartype($a_vartype);
61  }
62 
63  public function setVartype(string $a_vartype): void
64  {
65  $this->vartype = $a_vartype;
66  }
67 
68  public function getVartype(): ?string
69  {
70  return $this->vartype;
71  }
72 
73  public function setCase(string $a_case): void
74  {
75  switch (strtolower($a_case)) {
76  case "1":
77  case "yes":
78  $this->case = self::CASE_YES;
79  break;
80  case "2":
81  case "no":
82  $this->case = self::CASE_NO;
83  break;
84  }
85  }
86 
87  public function getCase(): ?string
88  {
89  return $this->case;
90  }
91 
92  public function setRespident(string $a_respident): void
93  {
94  $this->respident = $a_respident;
95  }
96 
97  public function getRespident(): ?string
98  {
99  return $this->respident;
100  }
101 
102  public function setIndex(string $a_index): void
103  {
104  $this->index = $a_index;
105  }
106 
107  public function getIndex(): ?string
108  {
109  return $this->index;
110  }
111 
112  public function setSetmatch(string $a_setmatch): void
113  {
114  switch (strtolower($a_setmatch)) {
115  case "1":
116  case "partial":
117  $this->setmatch = self::SETMATCH_PARTIAL;
118  break;
119  case "2":
120  case "exact":
121  $this->setmatch = self::SETMATCH_EXACT;
122  break;
123  }
124  }
125 
126  public function getSetmatch(): ?string
127  {
128  return $this->setmatch;
129  }
130 
131  public function setAreatype(string $a_areatype): void
132  {
133  switch (strtolower($a_areatype)) {
134  case "1":
135  case "ellipse":
136  $this->areatype = self::AREATYPE_ELLIPSE;
137  break;
138  case "2":
139  case "rectangle":
140  $this->areatype = self::AREATYPE_RECTANGLE;
141  break;
142  case "3":
143  case "bounded":
144  $this->areatype = self::AREATYPE_BOUNDED;
145  break;
146  }
147  }
148 
149  public function getAreatype(): ?string
150  {
151  return $this->areatype;
152  }
153 
154  public function setContent(string $a_content): void
155  {
156  $this->content = $a_content;
157  }
158 
159  public function getContent(): ?string
160  {
161  return $this->content;
162  }
163 }
setAreatype(string $a_areatype)
setVartype(string $a_vartype)
setRespident(string $a_respident)
setSetmatch(string $a_setmatch)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setContent(string $a_content)
setIndex(string $a_index)
__construct(string $a_vartype)