3 declare(strict_types=0);
17 foreach ($status_info[
'in_progress'] as $in_progress) {
18 $users = array_merge($users, $in_progress);
20 $users = array_unique($users);
37 $items = $status_info[
'scos'];
40 foreach ($items as $sco_id) {
41 $tmp_users = $status_info[
'completed'][$sco_id];
46 $users = array_intersect($users, $tmp_users);
58 if (!count($status_info[
'scos'])) {
62 foreach ($status_info[
'scos'] as $sco_id) {
65 (array) $status_info[
'failed'][$sco_id]
68 return array_unique($users);
99 $collection = $olp->getCollectionInstance();
101 $status_info[
'scos'] = $collection->getItems();
103 $status_info[
'scos'] = array();
105 $status_info[
'num_scos'] = count($status_info[
'scos']);
112 switch ($status_info[
'subtype']) {
116 $status_info[
'scos'],
120 foreach (ilObjAICCLearningModule::_getTrackingItems(
123 if (in_array($item[
'obj_id'], $status_info[
'scos'])) {
124 $status_info[
'scos_title'][
"$item[obj_id]"] = $item[
'title'];
128 $status_info[
'scos'],
135 $status_info[
'scos'],
139 foreach ($status_info[
'scos'] as $sco_id) {
145 $status_info[
'scos'],
152 $status_info[
'scos'],
156 foreach ($status_info[
'scos'] as $sco_id) {
163 $status_info[
'scos'],
170 $status_info[
'completed'] = array();
171 $status_info[
'failed'] = array();
172 $status_info[
'in_progress'] = array();
173 foreach ($status_info[
'scos'] as $sco_id) {
174 $status_info[
'completed'][$sco_id] = $info[
'completed'][$sco_id] ?? array();
175 $status_info[
'failed'][$sco_id] = $info[
'failed'][$sco_id] ?? array();
176 $status_info[
'in_progress'][$sco_id] = $info[
'in_progress'][$sco_id] ?? array();
189 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
194 $status = self::LP_STATUS_IN_PROGRESS_NUM;
198 $collection = $olp->getCollectionInstance();
200 $scos = $collection->getItems();
226 switch ($scorm_status) {
228 $status = self::LP_STATUS_IN_PROGRESS_NUM;
231 $status = self::LP_STATUS_COMPLETED_NUM;
234 $status = self::LP_STATUS_FAILED_NUM;
247 ?
object $a_obj = null
251 $collection = $olp->getCollectionInstance();
255 $scos = $collection->getItems();
256 $reqscos = count($scos);
259 if ($subtype !=
"scorm2004") {
276 $per = min(100, 100 / $reqscos * $compl);
286 parent::refreshStatus($a_obj_id, $a_users);
292 $all_active_users = array_unique(
293 array_merge($in_progress, $completed, $failed)
298 if ($subtype !=
"scorm2004") {
308 $not_attempted_users = array_diff(
312 unset($all_tracked_users);
313 unset($all_active_users);
316 if ($not_attempted_users) {
317 foreach ($not_attempted_users as $usr_id) {
322 self::LP_STATUS_NOT_ATTEMPTED_NUM
static _getInProgress(int $a_obj_id)
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getCountCompletedPerUser(array $a_scorm_item_ids, int $a_obj_id, bool $a_omit_failed=false)
Get progress of selected scos.
static _getCollectionStatus(?array $a_scos, int $a_obj_id, int $a_user_id)
static _getItemProgressInfo(array $a_scorm_item_ids, int $a_obj_id, bool $a_omit_failed)
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
static _getTrackedUsers(int $a_obj_id)
Get all tracked users.
static hasAccessed(int $a_obj_id, int $a_usr_id)
Has accessed.
static _getProgressInfo(array $sco_item_ids, int $a_obj_id)
Get info about.
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static _lookupSubType(int $a_obj_id)
lookup subtype id (scorm, )
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
static _getCollectionStatus(array $a_scos, int $a_obj_id, int $a_user_id)
refreshStatus(int $a_obj_id, ?array $a_users=null)
static _getCompleted(int $a_obj_id)
static _getFailed(int $a_obj_id)
static _getNotAttempted(int $a_obj_id)
static _lookupTitle(int $a_obj_id)
static _getFailed(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getStatusInfo(int $a_obj_id)
static _lookupItemTitle(int $a_node_id)
static _getTrackedUsers(int $a_obj_id)
Get all tracked users.
static _countCompleted(?array $a_scos, int $a_obj_id, int $a_user_id)
static _getCountCompletedPerUser(array $a_scorm_item_ids, int $a_obj_id)
Get users who have status completed or passed.
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static writeStatus(int $a_obj_id, int $a_user_id, int $a_status, int $a_percentage=0, bool $a_force_per=false, ?int &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
Write status for user and object.
static _countCompleted(array $a_scos, int $a_obj_id, int $a_user_id, bool $a_omit_failed)
static getInstance(int $obj_id)