19declare(strict_types=1);
61 return $this->progress_db->getLearnerItems($this->usr_id, $this->ls_ref_id);
66 $current = $this->states_db->getCurrentItemsFor($this->ls_ref_id, [$this->usr_id]);
67 return max(0, $current[$this->usr_id]);
72 $current_position = 0;
74 foreach ($items as $index => $item) {
75 if ($item->getRefId() === $this->getCurrentItemRefId()) {
76 $current_position = $index;
79 return $current_position;
84 $states = $this->states_db->getStatesFor($this->ls_ref_id, [$this->usr_id]);
87 if (array_key_exists($ls_item->
getRefId(), $states)) {
88 return $states[$ls_item->
getRefId()];
91 new ILIAS\KioskMode\State()
96 ILIAS\KioskMode\State $state,
97 int $state_item_ref_id,
98 int $current_item_ref_id
100 $this->states_db->updateState(
111 $first_access = $this->states_db->getFirstAccessFor($this->ls_ref_id, [$this->usr_id]);
112 return $first_access[$this->usr_id];
Data holding class LSItem .
This combines calls to ProgressDB and StateDB to handle learner-items in the context of a specific LS...
getStateFor(LSItem $ls_item, View $view)
__construct(ilLearnerProgressDB $progress_db, ilLSStateDB $states_db, int $ls_ref_id, int $usr_id)
getLearningSequenceRefId()
ilLearnerProgressDB $progress_db
storeState(ILIAS\KioskMode\State $state, int $state_item_ref_id, int $current_item_ref_id)
Persistence for View-States.
Get LearningProgress and availability of items in sequence.
A kiosk mode view on a certain object.
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.