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