ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssOrderingElement Class Reference
+ Collaboration diagram for ilAssOrderingElement:

Public Member Functions

 __construct (int $id=-1)
 ilAssOrderingElement constructor. More...
 
 __clone ()
 Cloning. More...
 
 getClone ()
 
 getId ()
 
 setId (int $id)
 
 getRandomIdentifier ()
 
 setRandomIdentifier (int $random_identifier)
 
 getSolutionIdentifier ()
 
 setSolutionIdentifier (int $solution_identifier)
 
 setIndentation (int $indentation)
 
 getIndentation ()
 
 getPosition ()
 
 setPosition (int $position)
 
 getContent ()
 
 setContent ($content)
 
 getUploadImageFile ()
 
 setUploadImageFile ($uploadImageFile)
 
 getUploadImageName ()
 
 setUploadImageName ($uploadImageName)
 
 isImageUploadAvailable ()
 
 isImageRemovalRequest ()
 
 setImageRemovalRequest ($imageRemovalRequest)
 
 getImagePathWeb ()
 
 setImagePathWeb ($imagePathWeb)
 
 getImagePathFs ()
 
 setImagePathFs ($imagePathFs)
 
 getImageThumbnailPrefix ()
 
 setImageThumbnailPrefix ($imageThumbnailPrefix)
 
 isSameElement (ilAssOrderingElement $element)
 
 getStorageValue1 ($orderingType)
 
 getStorageValue2 ($orderingType)
 
 __toString ()
 
 getPresentationImageUrl ()
 
 getExportIdent ()
 
 isExportIdent (string $ident)
 
 setExportIdent ($ident)
 
 withRandomIdentifier (int $id)
 
 withSolutionIdentifier (int $id)
 
 withPosition (int $position)
 
 withIndentation (int $indentation)
 
 withContent (string $content)
 

Data Fields

const EXPORT_IDENT_PROPERTY_SEPARATOR = '_'
 
 $objectInstanceId
 
int $id
 

Static Public Attributes

static $objectInstanceCounter = 0
 

Protected Member Functions

 thumbnailFileExists ()
 
 getThumbnailFilePath ()
 
 getThumbnailFileUrl ()
 
 imageFileExists ()
 
 getImageFilePath ()
 
 getImageFileUrl ()
 

Protected Attributes

int $random_identifier = null
 this identifier is generated randomly it is recycled for known elements More...
 
int $solution_identifier = null
 this identifier is used to identify elements and is stored together with the set position and indentation More...
 
int $indentation = 0
 the correct width of indentation for the element More...
 
int $position = null
 the correct position in the ordering sequence More...
 
string $content = null
 
string $uploadImageName = null
 
string $uploadImageFile = null
 
bool $imageRemovalRequest = false
 
string $imagePathWeb = null
 
string $imagePathFs = null
 
 $imageThumbnailPrefix = null
 

Detailed Description

Definition at line 28 of file class.ilAssOrderingElement.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssOrderingElement::__construct ( int  $id = -1)

ilAssOrderingElement constructor.

Definition at line 82 of file class.ilAssOrderingElement.php.

References $id.

83  {
84  $this->id = $id;
85  $this->objectInstanceId = ++self::$objectInstanceCounter;
86  }

Member Function Documentation

◆ __clone()

ilAssOrderingElement::__clone ( )

Cloning.

Definition at line 91 of file class.ilAssOrderingElement.php.

92  {
93  $this->objectInstanceId = ++self::$objectInstanceCounter;
94  }

◆ __toString()

ilAssOrderingElement::__toString ( )

Definition at line 321 of file class.ilAssOrderingElement.php.

References getContent().

321  : string
322  {
323  return $this->getContent() ?? '';
324  }
+ Here is the call graph for this function:

◆ getClone()

ilAssOrderingElement::getClone ( )

Definition at line 96 of file class.ilAssOrderingElement.php.

97  {
98  return clone $this;
99  }

◆ getContent()

◆ getExportIdent()

ilAssOrderingElement::getExportIdent ( )

Definition at line 377 of file class.ilAssOrderingElement.php.

References getIndentation(), getPosition(), getRandomIdentifier(), and getSolutionIdentifier().

377  : string
378  {
379  $ident = array(
380  $this->getRandomIdentifier(),
381  $this->getSolutionIdentifier(),
382  $this->getPosition(),
383  $this->getIndentation()
384  );
385 
386  return implode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
387  }
+ Here is the call graph for this function:

◆ getId()

ilAssOrderingElement::getId ( )

Definition at line 101 of file class.ilAssOrderingElement.php.

References $id.

Referenced by ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject().

101  : int
102  {
103  return $this->id;
104  }
+ Here is the caller graph for this function:

◆ getImageFilePath()

ilAssOrderingElement::getImageFilePath ( )
protected

Definition at line 354 of file class.ilAssOrderingElement.php.

References getContent(), and getImagePathFs().

Referenced by imageFileExists().

354  : string
355  {
356  return $this->getImagePathFs() . $this->getContent();
357  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageFileUrl()

ilAssOrderingElement::getImageFileUrl ( )
protected

Definition at line 359 of file class.ilAssOrderingElement.php.

References getContent(), and getImagePathWeb().

Referenced by getPresentationImageUrl().

359  : string
360  {
361  return $this->getImagePathWeb() . $this->getContent();
362  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImagePathFs()

ilAssOrderingElement::getImagePathFs ( )
Returns
string

Definition at line 249 of file class.ilAssOrderingElement.php.

References $imagePathFs.

Referenced by getImageFilePath(), and getThumbnailFilePath().

249  : ?string
250  {
251  return $this->imagePathFs;
252  }
+ Here is the caller graph for this function:

◆ getImagePathWeb()

ilAssOrderingElement::getImagePathWeb ( )
Returns
string

Definition at line 233 of file class.ilAssOrderingElement.php.

References $imagePathWeb.

Referenced by getImageFileUrl(), and getThumbnailFileUrl().

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

◆ getImageThumbnailPrefix()

ilAssOrderingElement::getImageThumbnailPrefix ( )

Definition at line 262 of file class.ilAssOrderingElement.php.

References $imageThumbnailPrefix.

Referenced by getThumbnailFilePath(), and getThumbnailFileUrl().

+ Here is the caller graph for this function:

◆ getIndentation()

ilAssOrderingElement::getIndentation ( )

Definition at line 139 of file class.ilAssOrderingElement.php.

References $indentation.

Referenced by getExportIdent(), getStorageValue2(), ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject(), ILIAS\TA\Questions\Ordering\assOrderingQuestionDatabaseRepository\insertOrderingElement(), and isSameElement().

139  : int
140  {
141  return $this->indentation;
142  }
int $indentation
the correct width of indentation for the element
+ Here is the caller graph for this function:

◆ getPosition()

ilAssOrderingElement::getPosition ( )

Definition at line 144 of file class.ilAssOrderingElement.php.

References $position.

Referenced by getExportIdent(), getStorageValue1(), getStorageValue2(), ilAssOrderingFormValuesObjectsConverter\getStructValueFromObject(), ILIAS\TA\Questions\Ordering\assOrderingQuestionDatabaseRepository\insertOrderingElement(), and isSameElement().

144  : ?int
145  {
146  return $this->position;
147  }
int $position
the correct position in the ordering sequence
+ Here is the caller graph for this function:

◆ getPresentationImageUrl()

ilAssOrderingElement::getPresentationImageUrl ( )

Definition at line 364 of file class.ilAssOrderingElement.php.

References getImageFileUrl(), getThumbnailFileUrl(), imageFileExists(), and thumbnailFileExists().

Referenced by assOrderingQuestionGUI\getAnswerStatisticOrderingElementHtml(), and ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

364  : string
365  {
366  if ($this->thumbnailFileExists()) {
367  return $this->getThumbnailFileUrl();
368  }
369 
370  if ($this->imageFileExists()) {
371  return $this->getImageFileUrl();
372  }
373 
374  return '';
375  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRandomIdentifier()

ilAssOrderingElement::getRandomIdentifier ( )

◆ getSolutionIdentifier()

ilAssOrderingElement::getSolutionIdentifier ( )
Returns
int

Definition at line 124 of file class.ilAssOrderingElement.php.

References $solution_identifier.

Referenced by ilAssOrderingElementList\fetchIdentifier(), getExportIdent(), getStorageValue1(), ILIAS\TA\Questions\Ordering\assOrderingQuestionDatabaseRepository\insertOrderingElement(), and isSameElement().

124  : ?int
125  {
127  }
int $solution_identifier
this identifier is used to identify elements and is stored together with the set position and indenta...
+ Here is the caller graph for this function:

◆ getStorageValue1()

ilAssOrderingElement::getStorageValue1 (   $orderingType)

◆ getStorageValue2()

ilAssOrderingElement::getStorageValue2 (   $orderingType)

◆ getThumbnailFilePath()

ilAssOrderingElement::getThumbnailFilePath ( )
protected

Definition at line 335 of file class.ilAssOrderingElement.php.

References getContent(), getImagePathFs(), and getImageThumbnailPrefix().

Referenced by thumbnailFileExists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbnailFileUrl()

ilAssOrderingElement::getThumbnailFileUrl ( )
protected

Definition at line 340 of file class.ilAssOrderingElement.php.

References getContent(), getImagePathWeb(), and getImageThumbnailPrefix().

Referenced by getPresentationImageUrl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUploadImageFile()

ilAssOrderingElement::getUploadImageFile ( )

Definition at line 171 of file class.ilAssOrderingElement.php.

References $uploadImageFile.

Referenced by isImageUploadAvailable().

171  : ?string
172  {
173  return $this->uploadImageFile;
174  }
+ Here is the caller graph for this function:

◆ getUploadImageName()

ilAssOrderingElement::getUploadImageName ( )
Returns
string

Definition at line 190 of file class.ilAssOrderingElement.php.

References $uploadImageName.

190  : ?string
191  {
192  return $this->uploadImageName;
193  }

◆ imageFileExists()

ilAssOrderingElement::imageFileExists ( )
protected

Definition at line 345 of file class.ilAssOrderingElement.php.

References getContent(), and getImageFilePath().

Referenced by getPresentationImageUrl().

345  : bool
346  {
347  if (!$this->getContent()) {
348  return false;
349  }
350 
351  return file_exists($this->getImageFilePath());
352  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isExportIdent()

ilAssOrderingElement::isExportIdent ( string  $ident)

Definition at line 389 of file class.ilAssOrderingElement.php.

References $parts, ilAssOrderingElementList\isValidIndentation(), ilAssOrderingElementList\isValidPosition(), ilAssOrderingElementList\isValidRandomIdentifier(), and ilAssOrderingElementList\isValidSolutionIdentifier().

Referenced by setExportIdent().

389  : bool
390  {
391  if (!strlen($ident)) {
392  return false;
393  }
394 
395  $parts = explode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
396  return
397  count($parts) == 4
402  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImageRemovalRequest()

ilAssOrderingElement::isImageRemovalRequest ( )
Returns
bool

Definition at line 217 of file class.ilAssOrderingElement.php.

References $imageRemovalRequest.

217  : ?bool
218  {
220  }

◆ isImageUploadAvailable()

ilAssOrderingElement::isImageUploadAvailable ( )
Returns
bool

Definition at line 209 of file class.ilAssOrderingElement.php.

References getUploadImageFile().

209  : bool
210  {
211  return (bool) strlen($this->getUploadImageFile());
212  }
+ Here is the call graph for this function:

◆ isSameElement()

ilAssOrderingElement::isSameElement ( ilAssOrderingElement  $element)
Parameters
ilAssOrderingElement$element
Returns
bool

Definition at line 276 of file class.ilAssOrderingElement.php.

References getIndentation(), getPosition(), getRandomIdentifier(), and getSolutionIdentifier().

276  : bool
277  {
278  return [
279  $this->getRandomIdentifier(),
280  $this->getSolutionIdentifier(),
281  $this->getPosition(),
282  $this->getIndentation(),
283  ] == [
284  $element->getRandomIdentifier(),
285  $element->getSolutionIdentifier(),
286  $element->getPosition(),
287  $element->getIndentation()
288  ];
289  }
+ Here is the call graph for this function:

◆ setContent()

ilAssOrderingElement::setContent (   $content)

Definition at line 163 of file class.ilAssOrderingElement.php.

References $content.

163  : void
164  {
165  if (is_array($content)) {
166  $content = array_shift($content);
167  }
168  $this->content = $content;
169  }

◆ setExportIdent()

ilAssOrderingElement::setExportIdent (   $ident)

Definition at line 404 of file class.ilAssOrderingElement.php.

References isExportIdent(), setIndentation(), setPosition(), setRandomIdentifier(), and setSolutionIdentifier().

404  : void
405  {
406  if ($this->isExportIdent($ident)) {
407  list($randomId, $solutionId, $pos, $indent) = explode(
408  self::EXPORT_IDENT_PROPERTY_SEPARATOR,
409  $ident
410  );
411  $this->setRandomIdentifier((int) $randomId);
412  $this->setSolutionIdentifier((int) $solutionId);
413  $this->setPosition((int) $pos);
414  $this->setIndentation((int) $indent);
415  }
416  }
setRandomIdentifier(int $random_identifier)
setSolutionIdentifier(int $solution_identifier)
+ Here is the call graph for this function:

◆ setId()

ilAssOrderingElement::setId ( int  $id)

Definition at line 106 of file class.ilAssOrderingElement.php.

References $id.

106  : void
107  {
108  $this->id = $id;
109  }

◆ setImagePathFs()

ilAssOrderingElement::setImagePathFs (   $imagePathFs)
Parameters
string$imagePathFs

Definition at line 257 of file class.ilAssOrderingElement.php.

References $imagePathFs.

Referenced by assOrderingQuestionGUI\getAnswerStatisticOrderingElementHtml(), and ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

257  : void
258  {
259  $this->imagePathFs = $imagePathFs;
260  }
+ Here is the caller graph for this function:

◆ setImagePathWeb()

ilAssOrderingElement::setImagePathWeb (   $imagePathWeb)
Parameters
string$imagePathWeb

Definition at line 241 of file class.ilAssOrderingElement.php.

References $imagePathWeb.

Referenced by assOrderingQuestionGUI\getAnswerStatisticOrderingElementHtml(), and ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

241  : void
242  {
243  $this->imagePathWeb = $imagePathWeb;
244  }
+ Here is the caller graph for this function:

◆ setImageRemovalRequest()

ilAssOrderingElement::setImageRemovalRequest (   $imageRemovalRequest)
Parameters
bool$imageRemovalRequest

Definition at line 225 of file class.ilAssOrderingElement.php.

References $imageRemovalRequest.

225  : void
226  {
227  $this->imageRemovalRequest = $imageRemovalRequest;
228  }

◆ setImageThumbnailPrefix()

ilAssOrderingElement::setImageThumbnailPrefix (   $imageThumbnailPrefix)

Definition at line 267 of file class.ilAssOrderingElement.php.

References $imageThumbnailPrefix.

Referenced by assOrderingQuestionGUI\getAnswerStatisticOrderingElementHtml(), and ilAssOrderingFormValuesObjectsConverter\getImageContentValueFromObject().

267  : void
268  {
269  $this->imageThumbnailPrefix = $imageThumbnailPrefix;
270  }
+ Here is the caller graph for this function:

◆ setIndentation()

ilAssOrderingElement::setIndentation ( int  $indentation)

Definition at line 134 of file class.ilAssOrderingElement.php.

References $indentation.

Referenced by setExportIdent().

134  : void
135  {
136  $this->indentation = $indentation;
137  }
int $indentation
the correct width of indentation for the element
+ Here is the caller graph for this function:

◆ setPosition()

ilAssOrderingElement::setPosition ( int  $position)

Definition at line 149 of file class.ilAssOrderingElement.php.

References $position.

Referenced by setExportIdent().

149  : void
150  {
151  $this->position = $position;
152  }
int $position
the correct position in the ordering sequence
+ Here is the caller graph for this function:

◆ setRandomIdentifier()

ilAssOrderingElement::setRandomIdentifier ( int  $random_identifier)

Definition at line 116 of file class.ilAssOrderingElement.php.

References $random_identifier.

Referenced by ilAssOrderingElementList\populateIdentifier(), and setExportIdent().

116  : void
117  {
118  $this->random_identifier = $random_identifier;
119  }
int $random_identifier
this identifier is generated randomly it is recycled for known elements
+ Here is the caller graph for this function:

◆ setSolutionIdentifier()

ilAssOrderingElement::setSolutionIdentifier ( int  $solution_identifier)

Definition at line 129 of file class.ilAssOrderingElement.php.

References $solution_identifier.

Referenced by ilAssOrderingElementList\populateIdentifier(), and setExportIdent().

129  : void
130  {
131  $this->solution_identifier = $solution_identifier;
132  }
int $solution_identifier
this identifier is used to identify elements and is stored together with the set position and indenta...
+ Here is the caller graph for this function:

◆ setUploadImageFile()

ilAssOrderingElement::setUploadImageFile (   $uploadImageFile)
Parameters
string$uploadImageFile

Definition at line 179 of file class.ilAssOrderingElement.php.

References $uploadImageFile.

179  : void
180  {
181  if (is_array($uploadImageFile)) {
182  $uploadImageFile = array_shift($uploadImageFile);
183  }
184  $this->uploadImageFile = $uploadImageFile;
185  }

◆ setUploadImageName()

ilAssOrderingElement::setUploadImageName (   $uploadImageName)
Parameters
string$uploadImageName

Definition at line 198 of file class.ilAssOrderingElement.php.

References $uploadImageName.

198  : void
199  {
200  if (is_array($uploadImageName)) {
201  $uploadImageName = array_shift($uploadImageName);
202  }
203  $this->uploadImageName = $uploadImageName;
204  }

◆ thumbnailFileExists()

ilAssOrderingElement::thumbnailFileExists ( )
protected

Definition at line 326 of file class.ilAssOrderingElement.php.

References getContent(), and getThumbnailFilePath().

Referenced by getPresentationImageUrl().

326  : bool
327  {
328  if (!$this->getContent()) {
329  return false;
330  }
331 
332  return file_exists($this->getThumbnailFilePath());
333  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withContent()

ilAssOrderingElement::withContent ( string  $content)

Definition at line 443 of file class.ilAssOrderingElement.php.

References $content.

443  : self
444  {
445  $clone = clone $this;
446  $clone->content = $content;
447  return $clone;
448  }

◆ withIndentation()

ilAssOrderingElement::withIndentation ( int  $indentation)

Definition at line 437 of file class.ilAssOrderingElement.php.

References $indentation.

437  : self
438  {
439  $clone = clone $this;
440  $clone->indentation = $indentation;
441  return $clone;
442  }
int $indentation
the correct width of indentation for the element

◆ withPosition()

ilAssOrderingElement::withPosition ( int  $position)

Definition at line 431 of file class.ilAssOrderingElement.php.

References $position.

431  : self
432  {
433  $clone = clone $this;
434  $clone->position = $position;
435  return $clone;
436  }
int $position
the correct position in the ordering sequence

◆ withRandomIdentifier()

ilAssOrderingElement::withRandomIdentifier ( int  $id)

Definition at line 419 of file class.ilAssOrderingElement.php.

References $id.

Referenced by ILIAS\TA\Questions\Ordering\assOrderingQuestionDatabaseRepository\buildOrderingElement(), and assOrderingQuestionTest\testOrderingElementMutation().

419  : self
420  {
421  $clone = clone $this;
422  $clone->random_identifier = $id;
423  return $clone;
424  }
+ Here is the caller graph for this function:

◆ withSolutionIdentifier()

ilAssOrderingElement::withSolutionIdentifier ( int  $id)

Definition at line 425 of file class.ilAssOrderingElement.php.

References $id.

Referenced by assOrderingQuestionTest\testOrderingElementMutation().

425  : self
426  {
427  $clone = clone $this;
428  $clone->solution_identifier = $id;
429  return $clone;
430  }
+ Here is the caller graph for this function:

Field Documentation

◆ $content

string ilAssOrderingElement::$content = null
protected

Definition at line 71 of file class.ilAssOrderingElement.php.

Referenced by getContent(), setContent(), and withContent().

◆ $id

int ilAssOrderingElement::$id

◆ $imagePathFs

string ilAssOrderingElement::$imagePathFs = null
protected

Definition at line 76 of file class.ilAssOrderingElement.php.

Referenced by getImagePathFs(), and setImagePathFs().

◆ $imagePathWeb

string ilAssOrderingElement::$imagePathWeb = null
protected

Definition at line 75 of file class.ilAssOrderingElement.php.

Referenced by getImagePathWeb(), and setImagePathWeb().

◆ $imageRemovalRequest

bool ilAssOrderingElement::$imageRemovalRequest = false
protected

Definition at line 74 of file class.ilAssOrderingElement.php.

Referenced by isImageRemovalRequest(), and setImageRemovalRequest().

◆ $imageThumbnailPrefix

ilAssOrderingElement::$imageThumbnailPrefix = null
protected

◆ $indentation

int ilAssOrderingElement::$indentation = 0
protected

the correct width of indentation for the element

Definition at line 65 of file class.ilAssOrderingElement.php.

Referenced by getIndentation(), setIndentation(), and withIndentation().

◆ $objectInstanceCounter

ilAssOrderingElement::$objectInstanceCounter = 0
static

Definition at line 32 of file class.ilAssOrderingElement.php.

◆ $objectInstanceId

ilAssOrderingElement::$objectInstanceId

Definition at line 33 of file class.ilAssOrderingElement.php.

◆ $position

int ilAssOrderingElement::$position = null
protected

the correct position in the ordering sequence

Definition at line 70 of file class.ilAssOrderingElement.php.

Referenced by getPosition(), setPosition(), and withPosition().

◆ $random_identifier

int ilAssOrderingElement::$random_identifier = null
protected

this identifier is generated randomly it is recycled for known elements

the main purpose is to have a key that does not make the solution derivable and is therefore useable in the examines working form

Definition at line 48 of file class.ilAssOrderingElement.php.

Referenced by getRandomIdentifier(), and setRandomIdentifier().

◆ $solution_identifier

int ilAssOrderingElement::$solution_identifier = null
protected

this identifier is used to identify elements and is stored together with the set position and indentation

this happens for the examine's submit data as well, an order index is build and the elements are assigned using this identifier

it is an integer sequence starting at 0 that increments with every added element while obsolete numbers are not recycled

Definition at line 60 of file class.ilAssOrderingElement.php.

Referenced by getSolutionIdentifier(), and setSolutionIdentifier().

◆ $uploadImageFile

string ilAssOrderingElement::$uploadImageFile = null
protected

Definition at line 73 of file class.ilAssOrderingElement.php.

Referenced by getUploadImageFile(), and setUploadImageFile().

◆ $uploadImageName

string ilAssOrderingElement::$uploadImageName = null
protected

Definition at line 72 of file class.ilAssOrderingElement.php.

Referenced by getUploadImageName(), and setUploadImageName().

◆ EXPORT_IDENT_PROPERTY_SEPARATOR

const ilAssOrderingElement::EXPORT_IDENT_PROPERTY_SEPARATOR = '_'

Definition at line 30 of file class.ilAssOrderingElement.php.


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