ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 (string $image_path_fs)
 
 getImageThumbnailPrefix ()
 
 setImageThumbnailPrefix ($imageThumbnailPrefix)
 
 isSameElement (ilAssOrderingElement $element)
 
 getStorageValue1 (int $ordering_type)
 
 getStorageValue2 (int $ordering_type)
 
 __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 $image_path_fs = 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 315 of file class.ilAssOrderingElement.php.

References getContent().

315  : string
316  {
317  return $this->getContent() ?? '';
318  }
+ 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 371 of file class.ilAssOrderingElement.php.

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

371  : string
372  {
373  $ident = [
374  $this->getRandomIdentifier(),
375  $this->getSolutionIdentifier(),
376  $this->getPosition(),
377  $this->getIndentation()
378  ];
379 
380  return implode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
381  }
+ 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 348 of file class.ilAssOrderingElement.php.

References getContent(), and getImagePathFs().

Referenced by imageFileExists().

348  : string
349  {
350  return $this->getImagePathFs() . $this->getContent();
351  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageFileUrl()

ilAssOrderingElement::getImageFileUrl ( )
protected

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

References getContent(), and getImagePathWeb().

Referenced by getPresentationImageUrl().

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

◆ getImagePathFs()

ilAssOrderingElement::getImagePathFs ( )
Returns
string

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

References $image_path_fs.

Referenced by getImageFilePath(), and getThumbnailFilePath().

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

◆ getImagePathWeb()

ilAssOrderingElement::getImagePathWeb ( )
Returns
string

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

References $imagePathWeb.

Referenced by getImageFileUrl(), and getThumbnailFileUrl().

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

◆ getImageThumbnailPrefix()

ilAssOrderingElement::getImageThumbnailPrefix ( )

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

References $imageThumbnailPrefix.

Referenced by getThumbnailFilePath(), and getThumbnailFileUrl().

+ Here is the caller graph for this function:

◆ getIndentation()

ilAssOrderingElement::getIndentation ( )

◆ getPosition()

◆ getPresentationImageUrl()

ilAssOrderingElement::getPresentationImageUrl ( )

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

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

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

358  : string
359  {
360  if ($this->thumbnailFileExists()) {
361  return $this->getThumbnailFileUrl();
362  }
363 
364  if ($this->imageFileExists()) {
365  return $this->getImageFileUrl();
366  }
367 
368  return '';
369  }
+ 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\TestQuestionPool\Questions\Ordering\OrderingQuestionDatabaseRepository\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 ( int  $ordering_type)

◆ getStorageValue2()

ilAssOrderingElement::getStorageValue2 ( int  $ordering_type)

◆ getThumbnailFilePath()

ilAssOrderingElement::getThumbnailFilePath ( )
protected

Definition at line 329 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 334 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 339 of file class.ilAssOrderingElement.php.

References getContent(), and getImageFilePath().

Referenced by getPresentationImageUrl().

339  : bool
340  {
341  if (!$this->getContent()) {
342  return false;
343  }
344 
345  return file_exists($this->getImageFilePath());
346  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isExportIdent()

ilAssOrderingElement::isExportIdent ( string  $ident)

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

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

Referenced by setExportIdent().

383  : bool
384  {
385  if (!strlen($ident)) {
386  return false;
387  }
388 
389  $parts = explode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
390  return
391  count($parts) == 4
396  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isImageRemovalRequest()

ilAssOrderingElement::isImageRemovalRequest ( )
Returns
bool

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

References $imageRemovalRequest.

218  : ?bool
219  {
221  }

◆ isImageUploadAvailable()

ilAssOrderingElement::isImageUploadAvailable ( )
Returns
bool

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

References getUploadImageFile(), and null.

209  : bool
210  {
211  return $this->getUploadImageFile() !== null
212  && $this->getUploadImageFile() !== '';
213  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ isSameElement()

ilAssOrderingElement::isSameElement ( ilAssOrderingElement  $element)

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

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

270  : bool
271  {
272  return [
273  $this->getRandomIdentifier(),
274  $this->getSolutionIdentifier(),
275  $this->getPosition(),
276  $this->getIndentation(),
277  ] == [
278  $element->getRandomIdentifier(),
279  $element->getSolutionIdentifier(),
280  $element->getPosition(),
281  $element->getIndentation()
282  ];
283  }
+ 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 398 of file class.ilAssOrderingElement.php.

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

398  : void
399  {
400  if ($this->isExportIdent($ident)) {
401  list($randomId, $solutionId, $pos, $indent) = explode(
402  self::EXPORT_IDENT_PROPERTY_SEPARATOR,
403  $ident
404  );
405  $this->setRandomIdentifier((int) $randomId);
406  $this->setSolutionIdentifier((int) $solutionId);
407  $this->setPosition((int) $pos);
408  $this->setIndentation((int) $indent);
409  }
410  }
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 ( string  $image_path_fs)

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

References $image_path_fs.

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

255  : void
256  {
257  $this->image_path_fs = $image_path_fs;
258  }
+ Here is the caller graph for this function:

◆ setImagePathWeb()

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

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

References $imagePathWeb.

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

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

◆ setImageRemovalRequest()

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

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

References $imageRemovalRequest.

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

◆ setImageThumbnailPrefix()

ilAssOrderingElement::setImageThumbnailPrefix (   $imageThumbnailPrefix)

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

References $imageThumbnailPrefix.

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

265  : void
266  {
267  $this->imageThumbnailPrefix = $imageThumbnailPrefix;
268  }
+ 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 320 of file class.ilAssOrderingElement.php.

References getContent(), and getThumbnailFilePath().

Referenced by getPresentationImageUrl().

320  : bool
321  {
322  if (!$this->getContent()) {
323  return false;
324  }
325 
326  return file_exists($this->getThumbnailFilePath());
327  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withContent()

ilAssOrderingElement::withContent ( string  $content)

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

References $content.

437  : self
438  {
439  $clone = clone $this;
440  $clone->content = $content;
441  return $clone;
442  }

◆ withIndentation()

ilAssOrderingElement::withIndentation ( int  $indentation)

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

References $indentation.

431  : self
432  {
433  $clone = clone $this;
434  $clone->indentation = $indentation;
435  return $clone;
436  }
int $indentation
the correct width of indentation for the element

◆ withPosition()

ilAssOrderingElement::withPosition ( int  $position)

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

References $position.

425  : self
426  {
427  $clone = clone $this;
428  $clone->position = $position;
429  return $clone;
430  }
int $position
the correct position in the ordering sequence

◆ withRandomIdentifier()

ilAssOrderingElement::withRandomIdentifier ( int  $id)

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

References $id.

Referenced by ILIAS\TestQuestionPool\Questions\Ordering\OrderingQuestionDatabaseRepository\buildOrderingElement(), and assOrderingQuestionTest\testOrderingElementMutation().

413  : self
414  {
415  $clone = clone $this;
416  $clone->random_identifier = $id;
417  return $clone;
418  }
+ Here is the caller graph for this function:

◆ withSolutionIdentifier()

ilAssOrderingElement::withSolutionIdentifier ( int  $id)

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

References $id.

Referenced by assOrderingQuestionTest\testOrderingElementMutation().

419  : self
420  {
421  $clone = clone $this;
422  $clone->solution_identifier = $id;
423  return $clone;
424  }
+ 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

◆ $image_path_fs

string ilAssOrderingElement::$image_path_fs = 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: