ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties Class Reference
+ Collaboration diagram for ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties:

Public Member Functions

 __construct (private readonly \ilComponentFactory $component_factory, private readonly int $question_id, private ?int $original_id=null, private ?string $external_id=null, private int $parent_object_id=0, private ?int $origin_object_id=null, private readonly int $type_id=0, private readonly string $class_name='', private int $owner=0, private string $title='', private string $description='', private string $question_text='', private float $available_points=0.0, private int $number_of_tries=0, private string $lifecycle='draft', private ?string $author=null, private int $updated_timestamp=0, private int $created_timestamp=0, private bool $complete=true, private readonly ?string $additional_content_editing_mode=null)
 
 getQuestionId ()
 
 getOriginalId ()
 
 withOriginalId (int $original_id)
 
 getExternalId ()
 
 withExternalId (string $external_id)
 
 getParentObjectId ()
 
 withParentObjectId (int $parent_id)
 
 getOriginObjectId ()
 
 withOriginObjectId (int $origin_object_id)
 
 getTypeId ()
 
 getClassName ()
 
 getGuiClassName ()
 
 getTypeName (Language $lng)
 
 getOwner ()
 
 withOwner (int $owner)
 
 getTitle ()
 
 withTitle (string $title)
 
 getDescription ()
 
 withDescription (string $description)
 
 getQuestionText ()
 
 withQuestionText (string $question_text)
 
 getAvailablePoints ()
 
 withMaximumPoints (float $reachable_points)
 
 getNumberOfTries ()
 
 withNumberOfTries (int $number_of_tries)
 
 getLifecycle ()
 
 withLifecycle (string $lifecycle)
 
 getAuthor ()
 
 withAuthor (string $author)
 
 getUpdatedTimestamp ()
 
 withUpdatedTimestamp (int $updated_timestamp)
 
 getCreatedTimestamp ()
 
 withCreatedTimestamp (int $created_timestamp)
 
 isRequiredInformationComplete ()
 
 withCompletionStatus (bool $complete)
 
 getAdditionalContentEditingMode ()
 
 isClone ()
 Checks whether the question is a clone of another question or not. More...
 
 toStorage ()
 

Detailed Description

Definition at line 25 of file GeneralQuestionProperties.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::__construct ( private readonly \ilComponentFactory  $component_factory,
private readonly int  $question_id,
private ?int  $original_id = null,
private ?string  $external_id = null,
private int  $parent_object_id = 0,
private ?int  $origin_object_id = null,
private readonly int  $type_id = 0,
private readonly string  $class_name = '',
private int  $owner = 0,
private string  $title = '',
private string  $description = '',
private string  $question_text = '',
private float  $available_points = 0.0,
private int  $number_of_tries = 0,
private string  $lifecycle = 'draft',
private ?string  $author = null,
private int  $updated_timestamp = 0,
private int  $created_timestamp = 0,
private bool  $complete = true,
private readonly ?string  $additional_content_editing_mode = null 
)

Definition at line 27 of file GeneralQuestionProperties.php.

48  {
49  }

Member Function Documentation

◆ getAdditionalContentEditingMode()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getAdditionalContentEditingMode ( )

Definition at line 269 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

269  : ?string
270  {
271  return $this->additional_content_editing_mode;
272  }
+ Here is the caller graph for this function:

◆ getAuthor()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getAuthor ( )

Definition at line 221 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

221  : ?string
222  {
223  return $this->author;
224  }
+ Here is the caller graph for this function:

◆ getAvailablePoints()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getAvailablePoints ( )

Definition at line 185 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

185  : float
186  {
187  return $this->available_points;
188  }
+ Here is the caller graph for this function:

◆ getClassName()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getClassName ( )

Definition at line 109 of file GeneralQuestionProperties.php.

109  : string
110  {
111  return $this->class_name;
112  }

◆ getCreatedTimestamp()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getCreatedTimestamp ( )

Definition at line 245 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

245  : int
246  {
247  return $this->created_timestamp;
248  }
+ Here is the caller graph for this function:

◆ getDescription()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getDescription ( )

Definition at line 161 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

161  : string
162  {
163  return $this->description;
164  }
+ Here is the caller graph for this function:

◆ getExternalId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getExternalId ( )

Definition at line 68 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

68  : ?string
69  {
70  return $this->external_id;
71  }
+ Here is the caller graph for this function:

◆ getGuiClassName()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getGuiClassName ( )

Definition at line 114 of file GeneralQuestionProperties.php.

114  : string
115  {
116  return $this->class_name . 'GUI';
117  }

◆ getLifecycle()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getLifecycle ( )

Definition at line 209 of file GeneralQuestionProperties.php.

References $lifecycle.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

209  : string
210  {
211  return $this->lifecycle;
212  }
$lifecycle
+ Here is the caller graph for this function:

◆ getNumberOfTries()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getNumberOfTries ( )

Definition at line 197 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

197  : int
198  {
199  return $this->number_of_tries;
200  }
+ Here is the caller graph for this function:

◆ getOriginalId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getOriginalId ( )

Definition at line 56 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

56  : ?int
57  {
58  return $this->original_id;
59  }
+ Here is the caller graph for this function:

◆ getOriginObjectId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getOriginObjectId ( )

Definition at line 92 of file GeneralQuestionProperties.php.

92  : ?int
93  {
94  return $this->origin_object_id;
95  }

◆ getOwner()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getOwner ( )

Definition at line 137 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

137  : int
138  {
139  return $this->owner;
140  }
+ Here is the caller graph for this function:

◆ getParentObjectId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getParentObjectId ( )

Definition at line 80 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

80  : int
81  {
82  return $this->parent_object_id;
83  }
+ Here is the caller graph for this function:

◆ getQuestionId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getQuestionId ( )

Definition at line 51 of file GeneralQuestionProperties.php.

Referenced by ILIAS\Test\Questions\Properties\DatabaseRepository\buildQuestionPropertiesFromGeneralQuestionPropertiesAndSquenceProperties(), and ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

51  : int
52  {
53  return $this->question_id;
54  }
+ Here is the caller graph for this function:

◆ getQuestionText()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getQuestionText ( )

Definition at line 173 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

173  : string
174  {
175  return $this->question_text;
176  }
+ Here is the caller graph for this function:

◆ getTitle()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getTitle ( )

Definition at line 149 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

149  : string
150  {
151  return $this->title;
152  }
+ Here is the caller graph for this function:

◆ getTypeId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getTypeId ( )

Definition at line 104 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

104  : int
105  {
106  return $this->type_id;
107  }
+ Here is the caller graph for this function:

◆ getTypeName()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getTypeName ( Language  $lng)

Definition at line 119 of file GeneralQuestionProperties.php.

References ILIAS\Language\Language\txt().

119  : string
120  {
121  if ($this->class_name === '') {
122  return '';
123  }
124 
125  if (file_exists(ILIAS_ABSOLUTE_PATH . '/components/ILIAS/TestQuestionPool/classes/class.' . $this->class_name . '.php')) {
126  return $lng->txt($this->class_name);
127  }
128 
129  foreach ($this->component_factory->getActivePluginsInSlot('qst') as $pl) {
130  if ($pl->getQuestionType() === $this->class_name) {
131  return $pl->getQuestionTypeTranslation();
132  }
133  }
134  return '';
135  }
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

◆ getUpdatedTimestamp()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::getUpdatedTimestamp ( )

Definition at line 233 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

233  : int
234  {
235  return $this->updated_timestamp;
236  }
+ Here is the caller graph for this function:

◆ isClone()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::isClone ( )

Checks whether the question is a clone of another question or not.

Definition at line 277 of file GeneralQuestionProperties.php.

References null.

277  : bool
278  {
279  return $this->original_id !== null;
280  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ isRequiredInformationComplete()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::isRequiredInformationComplete ( )

Definition at line 257 of file GeneralQuestionProperties.php.

Referenced by ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\toStorage().

257  : bool
258  {
259  return $this->complete;
260  }
+ Here is the caller graph for this function:

◆ toStorage()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::toStorage ( )
Returns
array<string, mixed>

Definition at line 285 of file GeneralQuestionProperties.php.

References ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getAdditionalContentEditingMode(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getAuthor(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getAvailablePoints(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getCreatedTimestamp(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getDescription(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getExternalId(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getLifecycle(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getNumberOfTries(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getOriginalId(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getOwner(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getParentObjectId(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getQuestionId(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getQuestionText(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getTitle(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getTypeId(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\getUpdatedTimestamp(), ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties\isRequiredInformationComplete(), ilDBConstants\T_FLOAT, ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

285  : array
286  {
287  return [
288  'question_id' => [\ilDBConstants::T_INTEGER, $this->getQuestionId()],
289  'question_type_fi' => [\ilDBConstants::T_INTEGER, $this->getTypeId()],
290  'obj_fi' => [\ilDBConstants::T_INTEGER, $this->getParentObjectId()],
291  'title' => [\ilDBConstants::T_TEXT, $this->getTitle()],
292  'description' => [\ilDBConstants::T_TEXT, $this->getDescription()],
293  'author' => [\ilDBConstants::T_TEXT, $this->getAuthor()],
294  'owner' => [\ilDBConstants::T_INTEGER, $this->getOwner()],
295  'points' => [\ilDBConstants::T_FLOAT, $this->getAvailablePoints()],
296  'complete' => [\ilDBConstants::T_TEXT, $this->isRequiredInformationComplete()],
297  'original_id' => [\ilDBConstants::T_INTEGER, $this->getOriginalId()],
298  'tstamp' => [\ilDBConstants::T_INTEGER, $this->getUpdatedTimestamp()],
299  'created' => [\ilDBConstants::T_INTEGER, $this->getCreatedTimestamp()],
300  'nr_of_tries' => [\ilDBConstants::T_INTEGER, $this->getNumberOfTries()],
301  'question_text' => [\ilDBConstants::T_TEXT, $this->getQuestionText()],
302  'add_content_edit_mode' => [\ilDBConstants::T_TEXT, $this->getAdditionalContentEditingMode()],
303  'external_id' => [\ilDBConstants::T_TEXT, $this->getExternalId()],
304  'lifecycle' => [\ilDBConstants::T_TEXT, $this->getLifecycle()]
305  ];
306  }
+ Here is the call graph for this function:

◆ withAuthor()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withAuthor ( string  $author)

Definition at line 226 of file GeneralQuestionProperties.php.

226  : self
227  {
228  $clone = clone $this;
229  $clone->author = $author;
230  return $clone;
231  }

◆ withCompletionStatus()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withCompletionStatus ( bool  $complete)

Definition at line 262 of file GeneralQuestionProperties.php.

262  : self
263  {
264  $clone = clone $this;
265  $clone->complete = $complete;
266  return $clone;
267  }

◆ withCreatedTimestamp()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withCreatedTimestamp ( int  $created_timestamp)

Definition at line 250 of file GeneralQuestionProperties.php.

250  : self
251  {
252  $clone = clone $this;
253  $clone->created_timestamp = $created_timestamp;
254  return $clone;
255  }

◆ withDescription()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withDescription ( string  $description)

Definition at line 166 of file GeneralQuestionProperties.php.

166  : self
167  {
168  $clone = clone $this;
169  $clone->description = $description;
170  return $clone;
171  }

◆ withExternalId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withExternalId ( string  $external_id)

Definition at line 73 of file GeneralQuestionProperties.php.

73  : self
74  {
75  $clone = clone $this;
76  $clone->external_id = $external_id;
77  return $clone;
78  }

◆ withLifecycle()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withLifecycle ( string  $lifecycle)

Definition at line 214 of file GeneralQuestionProperties.php.

References $lifecycle.

214  : self
215  {
216  $clone = clone $this;
217  $clone->lifecycle = $lifecycle;
218  return $clone;
219  }
$lifecycle

◆ withMaximumPoints()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withMaximumPoints ( float  $reachable_points)

Definition at line 190 of file GeneralQuestionProperties.php.

190  : self
191  {
192  $clone = clone $this;
193  $clone->reachable_points = $reachable_points;
194  return $clone;
195  }

◆ withNumberOfTries()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withNumberOfTries ( int  $number_of_tries)

Definition at line 202 of file GeneralQuestionProperties.php.

202  : self
203  {
204  $clone = clone $this;
205  $clone->number_of_tries = $number_of_tries;
206  return $clone;
207  }

◆ withOriginalId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withOriginalId ( int  $original_id)

Definition at line 61 of file GeneralQuestionProperties.php.

61  : self
62  {
63  $clone = clone $this;
64  $clone->original_id = $original_id;
65  return $clone;
66  }

◆ withOriginObjectId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withOriginObjectId ( int  $origin_object_id)

Definition at line 97 of file GeneralQuestionProperties.php.

97  : self
98  {
99  $clone = clone $this;
100  $clone->origin_object_id = $origin_object_id;
101  return $clone;
102  }

◆ withOwner()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withOwner ( int  $owner)

Definition at line 142 of file GeneralQuestionProperties.php.

142  : self
143  {
144  $clone = clone $this;
145  $clone->owner = $owner;
146  return $clone;
147  }

◆ withParentObjectId()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withParentObjectId ( int  $parent_id)

Definition at line 85 of file GeneralQuestionProperties.php.

85  : self
86  {
87  $clone = clone $this;
88  $clone->parent_object_id = $parent_id;
89  return $clone;
90  }

◆ withQuestionText()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withQuestionText ( string  $question_text)

Definition at line 178 of file GeneralQuestionProperties.php.

178  : self
179  {
180  $clone = clone $this;
181  $clone->question_text = $question_text;
182  return $clone;
183  }

◆ withTitle()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withTitle ( string  $title)

Definition at line 154 of file GeneralQuestionProperties.php.

154  : self
155  {
156  $clone = clone $this;
157  $clone->title = $title;
158  return $clone;
159  }

◆ withUpdatedTimestamp()

ILIAS\TestQuestionPool\Questions\GeneralQuestionProperties::withUpdatedTimestamp ( int  $updated_timestamp)

Definition at line 238 of file GeneralQuestionProperties.php.

238  : self
239  {
240  $clone = clone $this;
241  $clone->updated_timestamp = $updated_timestamp;
242  return $clone;
243  }

The documentation for this class was generated from the following file: