1 <?php declare(strict_types=1);
17 $this->progress_db = $progress_db;
18 $this->states_db = $states_db;
19 $this->ls_ref_id = $ls_ref_id;
20 $this->usr_id = $usr_id;
28 return $this->progress_db->getLearnerItems($this->usr_id, $this->ls_ref_id);
33 $current = $this->states_db->getCurrentItemsFor($this->ls_ref_id, [$this->usr_id]);
34 $ref_id = max(0, $current[$this->usr_id]);
40 $current_position = 0;
42 foreach ($items as
$index => $item) {
44 $current_position =
$index;
47 return $current_position;
52 $states = $this->states_db->getStatesFor($this->ls_ref_id, [$this->usr_id]);
53 $states = $states[$this->usr_id];
55 if (array_key_exists($ls_item->
getRefId(), $states)) {
56 return $states[$ls_item->
getRefId()];
58 return $view->buildInitialState(
59 new ILIAS\KioskMode\State()
64 ILIAS\KioskMode\State $state,
65 int $state_item_ref_id,
66 int $current_item_ref_id
68 $this->states_db->updateState(
79 $first_access = $this->states_db->getFirstAccessFor($this->ls_ref_id, [$this->usr_id]);
80 return $first_access[$this->usr_id];
Class ChatMainBarProvider .
getStateFor(LSItem $ls_item, \ILIAS\KioskMode\View $view)
storeState(ILIAS\KioskMode\State $state, int $state_item_ref_id, int $current_item_ref_id)
Data holding class LSItem .
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.
__construct(ilLearnerProgressDB $progress_db, ilLSStateDB $states_db, int $ls_ref_id, int $usr_id)