ILIAS  release_8 Revision v8.24
class.ilLPStatusSCORMPackage.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=0);
4
5/*
6 +-----------------------------------------------------------------------------+
7 | ILIAS open source |
8 +-----------------------------------------------------------------------------+
9 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
10 | |
11 | This program is free software; you can redistribute it and/or |
12 | modify it under the terms of the GNU General Public License |
13 | as published by the Free Software Foundation; either version 2 |
14 | of the License, or (at your option) any later version. |
15 | |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | GNU General Public License for more details. |
20 | |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program; if not, write to the Free Software |
23 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
24 +-----------------------------------------------------------------------------+
25*/
26
28{
29 public static function _getInProgress(int $a_obj_id): array
30 {
31 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
32 $users = $status_info['in_progress'];
33 return array_unique($users);
34 }
35
36 public static function _getCompleted(int $a_obj_id): array
37 {
38 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
39 $users = $status_info['completed'];
40 return array_unique($users);
41 }
42
43 public static function _getFailed(int $a_obj_id): array
44 {
45 $status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
46 $users = $status_info['failed'];
47 return array_unique($users);
48 }
49
50 public static function _getStatusInfo(int $a_obj_id): array
51 {
52 $status_info['subtype'] = "scorm2004";
54
55 $status_info['completed'] = $info['completed'];
56 $status_info['failed'] = $info['failed'];
57 $status_info['in_progress'] = $info['in_progress'];
58
59 return $status_info;
60 }
61
69 public function determineStatus(
70 int $a_obj_id,
71 int $a_usr_id,
72 object $a_obj = null
73 ): int {
74 global $DIC;
75
76 $ilObjDataCache = $DIC['ilObjDataCache'];
77 $ilDB = $DIC['ilDB'];
78 $ilLog = $DIC['ilLog'];
79
81 $a_obj_id,
82 $a_usr_id
83 );
85 switch ($scorm_status) {
86 case "in_progress":
88 break;
89 case "completed":
91 break;
92 case "failed":
94 break;
95 }
96
97 return $status;
98 }
99
100 public function refreshStatus(int $a_obj_id, ?array $a_users = null): void
101 {
102 parent::refreshStatus($a_obj_id, $a_users);
103
104 $in_progress = ilLPStatusWrapper::_getInProgress($a_obj_id);
105 $completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
106 $failed = ilLPStatusWrapper::_getFailed($a_obj_id);
107 $all_active_users = array_unique(
108 array_merge($in_progress, $completed, $failed)
109 );
110
111 // get all tracked users regardless of SCOs
112 $all_tracked_users = ilSCORM2004Tracking::_getTrackedUsers($a_obj_id);
113
114 $not_attempted_users = array_diff(
115 $all_tracked_users,
116 $all_active_users
117 );
118 unset($all_tracked_users);
119 unset($all_active_users);
120
121 // reset all users which have no data for the current SCOs
122 if ($not_attempted_users) {
123 foreach ($not_attempted_users as $usr_id) {
124 // this will update any (parent) collections if necessary
126 $a_obj_id,
127 $usr_id,
128 self::LP_STATUS_NOT_ATTEMPTED_NUM,
129 0
130 );
131 }
132 }
133 }
134
135 public function determinePercentage(
136 int $a_obj_id,
137 int $a_usr_id,
138 ?object $a_obj = null
139 ): int {
140 return 0;//todo!
141 }
142}
static _getStatusInfo(int $a_obj_id)
refreshStatus(int $a_obj_id, ?array $a_users=null)
Refresh status.
static _getInProgress(int $a_obj_id)
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
Determine status.
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getFailed(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getStatusInfo(int $a_obj_id)
Reads informations about the object e.g test results, tlt, number of visits.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
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.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
ilObjectDataCache $ilObjDataCache
const LP_STATUS_FAILED_NUM
static _getTrackedUsers(int $a_obj_id)
Get all tracked users.
static _getProgressInfoOfUser(int $a_obj_id, int $a_user_id)
Get overall scorm status.
static _getProgressInfo(int $a_obj_id)
Get overall scorm status.
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
global $DIC
Definition: feed.php:28