ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent Class Reference

Controls adaptive learning sequence content management. More...

+ Inheritance diagram for ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent:
+ Collaboration diagram for ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent:

Public Member Functions

 __construct (ilObjLearningSequenceContentGUI $parent_gui, Factory $ui_factory, Renderer $ui_renderer, ilLanguage $lng, ilCtrl $ctrl, ServerRequestInterface $request, ilGlobalTemplateInterface $tpl, int $ref_id, int $obj_id)
 Creates the adaptive content controller. More...
 
 getSupportedCommands ()
 Gets the commands supported by the controller. More...
 
 manageContent ()
 Renders the adaptive content management view. More...
 
 getSpecificActions (int $ref_id, int $start_ref_id, int $end_ref_id)
 Gets actions specific to an adaptive learning sequence item. More...
 
 setStartObject ()
 Sets the selected item as the start object. More...
 
 unsetStartObject ()
 Removes the start object. More...
 
 setEndObject ()
 Sets the selected item as the end object. More...
 
 unsetEndObject ()
 Removes the end object. More...
 
 manageContent ()
 Renders the content management view (the default command). More...
 
 getSupportedCommands ()
 The list of commands this controller is responsible for. More...
 

Protected Member Functions

 getStaticInputConfigurationIssues (array $items, AdaptiveNavigator $navigator)
 
 isMisconfiguredRefId (int $ref_id, array $misconfigured_ref_ids)
 
 getObjectTitleList (array $ref_ids)
 Builds a readable list of object titles for the given ref ids. More...
 
 getTableData (array $items, ?array $filter_data, array $structural_successors, array $misconfigured_ref_ids, array $issue_details_by_ref_id)
 Gets the filtered content table data. More...
 
 getInputConditionOptions ()
 Gets input condition filter options. More...
 
 getOutputConditionOptions ()
 Gets output condition filter options. More...
 

Protected Attributes

ilObjLearningSequenceContentGUI $parent_gui
 Parent content GUI. More...
 
Factory $ui_factory
 UI factory. More...
 
Renderer $ui_renderer
 UI renderer. More...
 
ilLanguage $lng
 Language service. More...
 
ilCtrl $ctrl
 Controller service. More...
 
ServerRequestInterface $request
 Server request. More...
 
ilGlobalTemplateInterface $tpl
 Global template. More...
 
int $ref_id
 Learning sequence repository reference ID. More...
 
int $obj_id
 Learning sequence object ID. More...
 

Private Member Functions

 getConditionTypes ()
 Gets the condition types contributed to the learning sequence. More...
 
 getBoundaries ()
 Gets the repository of the start and end objects. More...
 

Private Attributes

ilObjLearningSequence $lso = null
 Learning sequence object, loaded on first use. More...
 

Detailed Description

Controls adaptive learning sequence content management.

Definition at line 49 of file LSOAdaptiveContent.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::__construct ( ilObjLearningSequenceContentGUI  $parent_gui,
Factory  $ui_factory,
Renderer  $ui_renderer,
ilLanguage  $lng,
ilCtrl  $ctrl,
ServerRequestInterface  $request,
ilGlobalTemplateInterface  $tpl,
int  $ref_id,
int  $obj_id 
)

Creates the adaptive content controller.

Definition at line 77 of file LSOAdaptiveContent.php.

87 {
88 $this->parent_gui = $parent_gui;
89 $this->ui_factory = $ui_factory;
90 $this->ui_renderer = $ui_renderer;
91 $this->lng = $lng;
92 $this->ctrl = $ctrl;
93 $this->request = $request;
94 $this->tpl = $tpl;
95 $this->ref_id = $ref_id;
96 $this->obj_id = $obj_id;
97 }
ilObjLearningSequenceContentGUI $parent_gui
Parent content GUI.
int $ref_id
Learning sequence repository reference ID.

References ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ctrl, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$lng, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$obj_id, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$parent_gui, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ref_id, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$request, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$tpl, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ui_factory, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ui_renderer, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getBoundaries()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getBoundaries ( )
private

Gets the repository of the start and end objects.

Definition at line 446 of file LSOAdaptiveContent.php.

446 : LSOAdaptiveBoundaries
447 {
448 return $this->getLSO()->getDI()["db.boundaries"];
449 }

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

+ Here is the caller graph for this function:

◆ getConditionTypes()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getConditionTypes ( )
private

Gets the condition types contributed to the learning sequence.

Definition at line 438 of file LSOAdaptiveContent.php.

438 : ConditionTypes
439 {
440 return $this->getLSO()->getDI()["conditions.types"];
441 }

◆ getInputConditionOptions()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getInputConditionOptions ( )
protected

Gets input condition filter options.

Returns
array<string, string>

Definition at line 416 of file LSOAdaptiveContent.php.

416 : array
417 {
418 return $this->buildConditionOptions(
419 $this->getConditionTypes()->getAllInputConditions()
420 );
421 }
getConditionTypes()
Gets the condition types contributed to the learning sequence.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

+ Here is the caller graph for this function:

◆ getObjectTitleList()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getObjectTitleList ( array  $ref_ids)
protected

Builds a readable list of object titles for the given ref ids.

Parameters
int[]$ref_idsRef ids of the connected objects.

Definition at line 220 of file LSOAdaptiveContent.php.

220 : string
221 {
222 $titles = [];
223 foreach (array_unique($ref_ids) as $ref_id) {
225 }
226 sort($titles);
227
228 if ($titles === []) {
229 return $this->lng->txt('no_conditions');
230 }
231
232 return implode(', ', $titles);
233 }
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)

References ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ref_id, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\lng(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

+ Here is the call graph for this function:

◆ getOutputConditionOptions()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getOutputConditionOptions ( )
protected

Gets output condition filter options.

Returns
array<string, string>

Definition at line 428 of file LSOAdaptiveContent.php.

428 : array
429 {
430 return $this->buildConditionOptions(
431 $this->getConditionTypes()->getAllOutputConditions()
432 );
433 }

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

+ Here is the caller graph for this function:

◆ getSpecificActions()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getSpecificActions ( int  $ref_id,
int  $start_ref_id,
int  $end_ref_id 
)

Gets actions specific to an adaptive learning sequence item.

Returns
array<string, ilObjLearningSequenceActionData>

Definition at line 490 of file LSOAdaptiveContent.php.

490 : array
491 {
492 $specific_actions = [];
493
494 // 1. Conditions
495 $this->ctrl->setParameterByClass(ilObjLearningSequenceConditionsGUI::class, 'item_ref_id', $ref_id);
496 $link = $this->ctrl->getLinkTargetByClass(ilObjLearningSequenceConditionsGUI::class, 'manageConditions');
497 $specific_actions['conditions'] = new ilObjLearningSequenceActionData(
498 label: $this->lng->txt('conditions'),
499 link: $link
500 );
501
502 // 2. Start / End Switcher
503 if ($ref_id > 0) {
504 if ($ref_id === $start_ref_id) {
505 $label = $this->lng->txt('unset_start_object');
507 $id = 'unset_start';
508 } else {
509 $label = $this->lng->txt('set_start_object');
511 $id = 'set_start';
512 }
513 $this->ctrl->setParameter($this->parent_gui, 'item_ref_id', $ref_id);
514 $link = $this->ctrl->getLinkTarget($this->parent_gui, $link);
515 $specific_actions[$id] = new ilObjLearningSequenceActionData(label: $label, link: $link);
516
517 if ($ref_id === $end_ref_id) {
518 $label = $this->lng->txt('unset_end_object');
520 $id = 'unset_end';
521 } else {
522 $label = $this->lng->txt('set_end_object');
524 $id = 'set_end';
525 }
526 $this->ctrl->setParameter($this->parent_gui, 'item_ref_id', $ref_id);
527 $link = $this->ctrl->getLinkTarget($this->parent_gui, $link);
528 $specific_actions[$id] = new ilObjLearningSequenceActionData(label: $label, link: $link);
529 } else {
530 // Template
531 $specific_actions['set_start'] = new ilObjLearningSequenceActionData(
532 label: $this->lng->txt('set_start_object'),
534 );
535 $specific_actions['unset_start'] = new ilObjLearningSequenceActionData(
536 label: $this->lng->txt('unset_start_object'),
538 );
539 $specific_actions['set_end'] = new ilObjLearningSequenceActionData(
540 label: $this->lng->txt('set_end_object'),
542 );
543 $specific_actions['unset_end'] = new ilObjLearningSequenceActionData(
544 label: $this->lng->txt('unset_end_object'),
546 );
547 }
548
549 $this->ctrl->setParameterByClass(ilObjLearningSequenceConditionsGUI::class, 'item_ref_id', '');
550 return $specific_actions;
551 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Data transfer object for an action in the learning sequence content table.
link(string $caption, string $href, bool $new_viewport=false)

References $id, ilObjLearningSequenceContentGUI\CMD_SET_END_OBJECT, ilObjLearningSequenceContentGUI\CMD_SET_START_OBJECT, ilObjLearningSequenceContentGUI\CMD_UNSET_END_OBJECT, ilObjLearningSequenceContentGUI\CMD_UNSET_START_OBJECT, ILIAS\Repository\ctrl(), ILIAS\Repository\link(), and ILIAS\Repository\lng().

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveTable\buildEnvironment().

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

◆ getStaticInputConfigurationIssues()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getStaticInputConfigurationIssues ( array  $items,
AdaptiveNavigator  $navigator 
)
protected
Parameters
\LSItem[]$itemsLearning sequence items.
Returns
StaticInputConfigurationIssue[]

Definition at line 197 of file LSOAdaptiveContent.php.

197 : array
198 {
199 $conditions_by_ref_id = [];
200 foreach ($items as $item) {
201 $conditions_by_ref_id[$item->getRefId()] = $navigator->getInputConditions($item);
202 }
203
204 return (new StaticInputConfigurationAnalyzer())->getIssues($conditions_by_ref_id);
205 }

References ILIAS\LearningSequence\Player\AdaptiveNavigator\getInputConditions().

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

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

◆ getSupportedCommands()

◆ getTableData()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::getTableData ( array  $items,
?array  $filter_data,
array  $structural_successors,
array  $misconfigured_ref_ids,
array  $issue_details_by_ref_id 
)
protected

Gets the filtered content table data.

Parameters
\LSItem[]$itemsLearning sequence items.
array<string,mixed>|null$filter_data Filter data.
array<int,int[]>$structural_successors Ref ids of the structural successors per item.
array<int,bool>$misconfigured_ref_ids
array<int,StaticInputConfigurationIssueDetail[]>$issue_details_by_ref_id
Returns
ilObjLearningSequenceContentData[]

Definition at line 245 of file LSOAdaptiveContent.php.

251 : array {
252 $boundaries_db = $this->getBoundaries();
253 $boundary_data = $boundaries_db->getBoundariesFor($this->obj_id);
254 $start_ref_id = $boundary_data['start_ref_id'];
255 $end_ref_id = $boundary_data['end_ref_id'];
256
257 $structural_predecessors = [];
258 foreach ($structural_successors as $source_ref_id => $successor_ref_ids) {
259 foreach ($successor_ref_ids as $successor_ref_id) {
260 $structural_predecessors[$successor_ref_id][] = (int) $source_ref_id;
261 }
262 }
263
264 $name_filter = $filter_data['name'] ?? '';
265 $input_filter = $filter_data['input_conditions'] ?? [];
266 $output_filter = $filter_data['output_conditions'] ?? [];
267 $online_filter = $filter_data['online_status'] ?? null;
268 $position_filter = $filter_data['position'] ?? [];
269
270 usort($items, function ($a, $b) use ($start_ref_id, $end_ref_id) {
271 if ($a->getRefId() === $start_ref_id) {
272 return -1;
273 }
274 if ($b->getRefId() === $start_ref_id) {
275 return 1;
276 }
277 if ($a->getRefId() === $end_ref_id) {
278 return 1;
279 }
280 if ($b->getRefId() === $end_ref_id) {
281 return -1;
282 }
283 return $a->getOrderNumber() <=> $b->getOrderNumber();
284 });
285
286 $condition_handler = $this->getLSO()->getDI()["conditions.handler"];
287 $lso_ref_id = $this->ref_id;
288
289 $data = [];
290 foreach ($items as $index => $item) {
291 $ref_id = $item->getRefId();
294
295 if ($name_filter !== '' && mb_stripos($title, $name_filter) === false) {
296 continue;
297 }
298
299 if ($online_filter !== null && $online_filter !== '') {
300 $is_online = $item->isOnline();
301 if ($online_filter === 'online' && !$is_online) {
302 continue;
303 }
304 if ($online_filter === 'offline' && $is_online) {
305 continue;
306 }
307 }
308
309 if (count($position_filter) > 0) {
310 $is_start = ($ref_id === $start_ref_id);
311 $is_end = ($ref_id === $end_ref_id);
312 $matches_position =
313 (in_array('start', $position_filter, true) && $is_start)
314 || (in_array('end', $position_filter, true) && $is_end);
315 if (!$matches_position) {
316 continue;
317 }
318 }
319
320 $type = $item->getType();
321
322 $input_conditions = [];
323 $db_input_conditions = $condition_handler->getInputConditionsByRefId($lso_ref_id, $ref_id);
324 foreach ($db_input_conditions as $db_cond) {
325 $input_conditions[] = new ilObjLearningSequenceConditionData(
326 title: $db_cond['title'],
327 value: $db_cond['value'],
328 internal_name: $db_cond['internal_name']
329 );
330 }
331
332 $output_conditions = [];
333 $db_output_conditions = $condition_handler->getOutputConditionsByRefId($lso_ref_id, $ref_id);
334 foreach ($db_output_conditions as $db_cond) {
335 $output_conditions[] = new ilObjLearningSequenceConditionData(
336 title: $db_cond['title'],
337 value: $db_cond['value'],
338 internal_name: $db_cond['internal_name']
339 );
340 }
341
342 if (count($input_filter) > 0) {
343 $found = false;
344 foreach ($input_conditions as $ic) {
345 if (in_array($ic->internal_name, $input_filter)) {
346 $found = true;
347 break;
348 }
349 }
350 if (!$found) {
351 continue;
352 }
353 }
354
355 if (count($output_filter) > 0) {
356 $found = false;
357 foreach ($output_conditions as $oc) {
358 if (in_array($oc->internal_name, $output_filter)) {
359 $found = true;
360 break;
361 }
362 }
363 if (!$found) {
364 continue;
365 }
366 }
367
368 // Information
369 $prev_title = $this->getObjectTitleList($structural_predecessors[$ref_id] ?? []);
370 $next_title = $this->getObjectTitleList($structural_successors[$ref_id] ?? []);
371
372 $icon_path = ilObject::_getIcon($obj_id, "small", $type);
373 $actions = $this->parent_gui->getTableActionHandler()->collectActions(
374 $ref_id,
375 $this->getSpecificActions(
376 $ref_id,
377 $start_ref_id,
378 $end_ref_id
379 ),
380 $item->isOnline()
381 );
382
384 $ref_id,
385 $obj_id,
386 $title,
388 $type,
389 $icon_path,
390 ilLink::_getLink($ref_id, $type),
391 $item->isOnline(),
392 ($ref_id === $start_ref_id) ? 'Start' : '',
393 ($ref_id === $end_ref_id) ? 'End' : '',
394 $prev_title,
395 $next_title,
396 $input_conditions,
397 $output_conditions,
398 $this->isMisconfiguredRefId($ref_id, $misconfigured_ref_ids),
399 $issue_details_by_ref_id[$ref_id] ?? [],
400 ($structural_predecessors[$ref_id] ?? []) !== [],
401 ($structural_successors[$ref_id] ?? []) !== [],
402 $actions
403 );
404
405 $data[] = $row;
406 }
407
408 return $data;
409 }
getBoundaries()
Gets the repository of the start and end objects.
getObjectTitleList(array $ref_ids)
Builds a readable list of object titles for the given ref ids.
getSpecificActions(int $ref_id, int $start_ref_id, int $end_ref_id)
Gets actions specific to an adaptive learning sequence item.
Data transfer object for a learning sequence condition.
Data transfer object for an item in the learning sequence content table.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupDescription(int $obj_id)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
if(!file_exists('../ilias.ini.php'))
$data
Definition: storeScorm.php:45

References ILIAS\Repository\int().

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

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

◆ isMisconfiguredRefId()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::isMisconfiguredRefId ( int  $ref_id,
array  $misconfigured_ref_ids 
)
protected
Parameters
array<int,bool>$misconfigured_ref_ids

Definition at line 210 of file LSOAdaptiveContent.php.

210 : bool
211 {
212 return isset($misconfigured_ref_ids[$ref_id]);
213 }

References ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$ref_id.

◆ manageContent()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::manageContent ( )

Renders the adaptive content management view.

Implements ILIAS\LearningSequence\Content\LSOContentController.

Definition at line 119 of file LSOAdaptiveContent.php.

119 : void
120 {
121 // Restore the "add new object" drilldown in the toolbar so that new
122 // objects can be created directly from the content management view.
123 $this->parent_gui->showPossibleSubObjects();
124
125 $lso = $this->getLSO();
126 $items = $lso->getLSItems();
127 $navigator = new AdaptiveNavigator($lso->getDI()["conditions.factory"]);
128 $navigator->preload($items);
129 $structural_successors = [];
130 foreach ($items as $item) {
131 $structural_successors[$item->getRefId()] = array_map(
132 static fn(\LSItem $successor): int => $successor->getRefId(),
133 $navigator->getStructuralSuccessors($items, $item)
134 );
135 }
136 $filter_gui = new LSOAdaptiveFilter($this->ui_factory, $this->lng, $this->ctrl, $this->parent_gui);
137 $filter = $filter_gui->getFilter(
138 'manageContent',
141 )->withRequest($this->request);
142
143 $filter_data = $filter->getData();
144 $analyzer = new StaticInputConfigurationAnalyzer();
145 $static_input_configuration_issues = $this->getStaticInputConfigurationIssues($items, $navigator);
146 $misconfigured_ref_ids = array_fill_keys(
147 $analyzer->getAffectedRefIds($static_input_configuration_issues),
148 true
149 );
150 $issue_details_by_ref_id = $analyzer->getIssueDetailsByRefId($static_input_configuration_issues);
151 $data = $this->getTableData(
152 $items,
153 $filter_data,
154 $structural_successors,
155 $misconfigured_ref_ids,
156 $issue_details_by_ref_id
157 );
158
159 $boundaries_db = $this->getBoundaries();
160 $boundary_data = $boundaries_db->getBoundariesFor($this->obj_id);
161
162 $missing_hints = [];
163 if ((int) $boundary_data['start_ref_id'] === 0) {
164 $missing_hints[] = $this->lng->txt('lso_adaptive_missing_start_object');
165 }
166 if ((int) $boundary_data['end_ref_id'] === 0) {
167 $missing_hints[] = $this->lng->txt('lso_adaptive_missing_end_object');
168 }
169 if ($missing_hints !== []) {
170 $this->tpl->setOnScreenMessage('info', implode('<br>', $missing_hints));
171 }
172
173 $table = new LSOAdaptiveTable(
174 $this->ui_factory,
175 $this->ui_renderer,
176 $data,
177 $filter,
178 (int) $boundary_data['start_ref_id'],
179 (int) $boundary_data['end_ref_id'],
180 $this->parent_gui,
181 $this->ref_id,
182 $this->lng,
183 $this->ctrl,
184 $this->request,
185 $this->tpl
186 );
187
188 $this->parent_gui->setContent(
189 $table->render()
190 );
191 }
getOutputConditionOptions()
Gets output condition filter options.
getTableData(array $items, ?array $filter_data, array $structural_successors, array $misconfigured_ref_ids, array $issue_details_by_ref_id)
Gets the filtered content table data.
getStaticInputConfigurationIssues(array $items, AdaptiveNavigator $navigator)
getInputConditionOptions()
Gets input condition filter options.
ilObjLearningSequence $lso
Learning sequence object, loaded on first use.
Provides condition-based navigation through an adaptive learning sequence.
Data holding class LSItem .
Definition: LSItem.php:25
getRefId()
Definition: LSItem.php:93

References $data, ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\$lso, ILIAS\Repository\ctrl(), ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\getBoundaries(), ilObjLearningSequence\getDI(), ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\getInputConditionOptions(), ilObjLearningSequence\getLSItems(), ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\getOutputConditionOptions(), LSItem\getRefId(), ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\getStaticInputConfigurationIssues(), ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\getTableData(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setEndObject()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::setEndObject ( )

Sets the selected item as the end object.

Definition at line 593 of file LSOAdaptiveContent.php.

593 : void
594 {
595 $ref_id = $this->parent_gui->extractItemRefId();
596 if ($ref_id > 0) {
597 $boundaries = $this->getBoundaries();
598 $current = $boundaries->getBoundariesFor($this->obj_id);
599 if ((int) $current['start_ref_id'] === $ref_id) {
600 // An object must never be start and end object at the same time.
601 $this->tpl->setOnScreenMessage(
602 'failure',
603 $this->lng->txt('lso_adaptive_start_end_not_same'),
604 true
605 );
606 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
607 }
608 $boundaries->setEndRefId($this->obj_id, $ref_id);
609 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
610 }
611 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
612 }

References ilObjLearningSequenceContentGUI\CMD_MANAGE_CONTENT, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setStartObject()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::setStartObject ( )

Sets the selected item as the start object.

Definition at line 556 of file LSOAdaptiveContent.php.

556 : void
557 {
558 $ref_id = $this->parent_gui->extractItemRefId();
559 if ($ref_id > 0) {
560 $boundaries = $this->getBoundaries();
561 $current = $boundaries->getBoundariesFor($this->obj_id);
562 if ((int) $current['end_ref_id'] === $ref_id) {
563 // An object must never be start and end object at the same time.
564 $this->tpl->setOnScreenMessage(
565 'failure',
566 $this->lng->txt('lso_adaptive_start_end_not_same'),
567 true
568 );
569 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
570 }
571 $boundaries->setStartRefId($this->obj_id, $ref_id);
572 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
573 }
574 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
575 }

References ilObjLearningSequenceContentGUI\CMD_MANAGE_CONTENT, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ unsetEndObject()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::unsetEndObject ( )

Removes the end object.

Definition at line 617 of file LSOAdaptiveContent.php.

617 : void
618 {
619 $boundaries = $this->getBoundaries();
620 $boundaries->unsetEndRefId($this->obj_id);
621 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
622
623 $this->enforceOfflineForMissingBoundaries($this->getLSO());
624 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
625 }
enforceOfflineForMissingBoundaries(\ilObjLearningSequence $lso)
An adaptive learning sequence may only be online if it has a start AND an end object.

References ilObjLearningSequenceContentGUI\CMD_MANAGE_CONTENT, ILIAS\Repository\ctrl(), ILIAS\LearningSequence\Content\enforceOfflineForMissingBoundaries(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ unsetStartObject()

ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::unsetStartObject ( )

Removes the start object.

Definition at line 580 of file LSOAdaptiveContent.php.

580 : void
581 {
582 $boundaries = $this->getBoundaries();
583 $boundaries->unsetStartRefId($this->obj_id);
584 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
585
586 $this->enforceOfflineForMissingBoundaries($this->getLSO());
587 $this->ctrl->redirect($this->parent_gui, ilObjLearningSequenceContentGUI::CMD_MANAGE_CONTENT);
588 }

References ilObjLearningSequenceContentGUI\CMD_MANAGE_CONTENT, ILIAS\Repository\ctrl(), ILIAS\LearningSequence\Content\enforceOfflineForMissingBoundaries(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$ctrl
protected

Controller service.

Definition at line 62 of file LSOAdaptiveContent.php.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\__construct().

◆ $lng

ilLanguage ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$lng
protected

◆ $lso

ilObjLearningSequence ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$lso = null
private

Learning sequence object, loaded on first use.

Definition at line 72 of file LSOAdaptiveContent.php.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\manageContent().

◆ $obj_id

int ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$obj_id
protected

Learning sequence object ID.

Definition at line 70 of file LSOAdaptiveContent.php.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\__construct().

◆ $parent_gui

ilObjLearningSequenceContentGUI ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$parent_gui
protected

Parent content GUI.

Definition at line 54 of file LSOAdaptiveContent.php.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\__construct().

◆ $ref_id

int ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$ref_id
protected

◆ $request

ServerRequestInterface ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$request
protected

◆ $tpl

ilGlobalTemplateInterface ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$tpl
protected

Global template.

Definition at line 66 of file LSOAdaptiveContent.php.

Referenced by ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent\__construct().

◆ $ui_factory

Factory ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$ui_factory
protected

◆ $ui_renderer

Renderer ILIAS\LearningSequence\Content\Adaptive\LSOAdaptiveContent::$ui_renderer
protected

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