19declare(strict_types=1);
293 switch ($ordering_type) {
308 switch ($ordering_type) {
386 return implode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
391 if (!strlen($ident)) {
395 $parts = explode(self::EXPORT_IDENT_PROPERTY_SEPARATOR, $ident);
407 list($randomId, $solutionId, $pos, $indent) = explode(
408 self::EXPORT_IDENT_PROPERTY_SEPARATOR,
421 $clone = clone $this;
422 $clone->random_identifier =
$id;
427 $clone = clone $this;
428 $clone->solution_identifier =
$id;
433 $clone = clone $this;
439 $clone = clone $this;
445 $clone = clone $this;
454 'id' => $transformations->
normalize(
new Id($this->
id,
'ordering')),
459 'content' => $this->content ? $transformations->
normalize(
460 new QuestionImage($this->content, $context[
'question_id'] ??
null)
469 ->withSolutionIdentifier($transformations->
int($normalized[
'solution_identifier']))
470 ->withPosition($transformations->
int($normalized[
'position']))
471 ->withIndentation($transformations->
int($normalized[
'indentation']));
473 if (is_array($normalized[
'content'])) {
474 $clone->setContent($transformations->
denormalize($normalized[
'content'], QuestionImage::class)?->getFilename());
476 $clone->setContent((
string) $normalized[
'content']);
479 $clone->setId($transformations->
denormalize($normalized[
'id'], Id::class)->getId());
Wrapper object for an object identifier and an optional object type the identifier belongs to.
Wrapper object for an image file within a question (e.g.
static isValidPosition($position)
static isValidRandomIdentifier($identifier)
static isValidSolutionIdentifier($identifier)
static isValidIndentation($indentation)
withContent(string $content)
int $position
the correct position in the ordering sequence
withIndentation(int $indentation)
isExportIdent(string $ident)
fromNormalized(array $normalized, Transformations $transformations)
Restore the object from its normalized representation.
setImagePathFs(string $image_path_fs)
int $indentation
the correct width of indentation for the element
__construct(int $id=-1)
ilAssOrderingElement constructor.
getStorageValue1(int $ordering_type)
getImageThumbnailPrefix()
setImageRemovalRequest($imageRemovalRequest)
setImagePathWeb($imagePathWeb)
setImageThumbnailPrefix($imageThumbnailPrefix)
setUploadImageName($uploadImageName)
withPosition(int $position)
setRandomIdentifier(int $random_identifier)
static $objectInstanceCounter
withRandomIdentifier(int $id)
getPresentationImageUrl()
isSameElement(ilAssOrderingElement $element)
setIndentation(int $indentation)
int $random_identifier
this identifier is generated randomly it is recycled for known elements
toNormalized(Transformations $transformations, array $context=[])
Convert the internal state of the implementing object into a language-neutral array structure.
setUploadImageFile($uploadImageFile)
setSolutionIdentifier(int $solution_identifier)
withSolutionIdentifier(int $id)
bool $imageRemovalRequest
getStorageValue2(int $ordering_type)
int $solution_identifier
this identifier is used to identify elements and is stored together with the set position and indenta...
const EXPORT_IDENT_PROPERTY_SEPARATOR
setPosition(int $position)