19 declare(strict_types=1);
56 return $this->progress_db->getLearnerItems($this->usr_id, $this->ls_ref_id);
61 $current = $this->states_db->getCurrentItemsFor($this->ls_ref_id, [$this->usr_id]);
62 return max(0, $current[$this->usr_id]);
67 $current_position = 0;
69 foreach ($items as $index => $item) {
71 $current_position = $index;
74 return $current_position;
79 $states = $this->states_db->getStatesFor($this->ls_ref_id, [$this->usr_id]);
82 if (array_key_exists($ls_item->
getRefId(), $states)) {
83 return $states[$ls_item->
getRefId()];
92 int $state_item_ref_id,
93 int $current_item_ref_id
95 $this->states_db->updateState(
106 $first_access = $this->states_db->getFirstAccessFor($this->ls_ref_id, [$this->usr_id]);
buildInitialState(State $empty_state)
Build an initial state based on the Provided empty state.
Interface Observer Contains several chained tasks and infos about them.
storeState(ILIAS\KioskMode\State $state, int $state_item_ref_id, int $current_item_ref_id)
A kiosk mode view on a certain object.
Data holding class LSItem .
getStateFor(LSItem $ls_item, View $view)
Persistence for View-States.
This combines calls to ProgressDB and StateDB to handle learner-items in the context of a specific LS...
Get LearningProgress and availability of items in sequence.
ilLearnerProgressDB $progress_db
__construct(ilLearnerProgressDB $progress_db, ilLSStateDB $states_db, int $ls_ref_id, int $usr_id)