ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLPStatusCourseReference Class Reference

Class ilLPStatusCourseReference. More...

+ Inheritance diagram for ilLPStatusCourseReference:
+ Collaboration diagram for ilLPStatusCourseReference:

Public Member Functions

 __construct (int $a_obj_id)
 
 getNotAttempted ()
 
 getInProgress ()
 
 getCompleted ()
 
 getStatusInfo ()
 
 readStatusInfo (int $a_obj_id)
 
 determineStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
 
- Public Member Functions inherited from ilLPStatus
 __construct (int $a_obj_id)
 
 _updateStatus (int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) Learning progress: More...
 
 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)
 
 refreshStatus (int $a_obj_id, ?array $a_users=null)
 Refresh status. More...
 

Static Public Member Functions

static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
Parameters
int$a_obj_id
Returns
int[]
More...
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
Parameters
int$a_obj_id
Returns
int[]
More...
 
static _getStatusInfo (int $a_obj_id)
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted (int $a_obj_id)
 
static _getNotAttempted (int $a_obj_id)
 
static _getCountInProgress (int $a_obj_id)
 
static _getInProgress (int $a_obj_id)
 
static _getCountCompleted (int $a_obj_id)
 
static _getCompleted (int $a_obj_id)
 
static _getFailed (int $a_obj_id)
 
static _getCountFailed (int $a_obj_id)
 
static _getStatusInfo (int $a_obj_id)
 
static _getTypicalLearningTime (string $type, int $obj_id, int $sub_id=0)
 
static checkStatusForObject (int $a_obj_id, ?array $a_users=null)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
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. More...
 
static setInProgressIfNotAttempted (int $a_obj_id, int $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty (int $a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus (int $a_obj_id, int $a_user_id, bool $a_create=true)
 Lookup status. More...
 
static _lookupPercentage (int $a_obj_id, int $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted (int $a_obj_id, int $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged (int $a_obj_id, int $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject (int $a_obj_id, ?array $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData (array $a_obj_ids)
 
static getListGUIStatus (int $a_obj_id, bool $a_image_only=true)
 
static hasListGUIStatus (int $a_obj_id)
 

Private Member Functions

 readTargetObjId (int $a_obj_id)
 

Static Private Member Functions

static getInstanceByObjId (int $a_reference_obj_id)
 

Private Attributes

int $target_obj_id = 0
 
array $status_info = []
 

Static Private Attributes

static $instances = []
 

Additional Inherited Members

- Data Fields inherited from ilLPStatus
const LP_STATUS_NOT_ATTEMPTED = 'trac_no_attempted'
 
const LP_STATUS_IN_PROGRESS = 'trac_in_progress'
 
const LP_STATUS_COMPLETED = 'trac_completed'
 
const LP_STATUS_FAILED = 'trac_failed'
 
const LP_STATUS_NOT_ATTEMPTED_NUM = 0
 
const LP_STATUS_IN_PROGRESS_NUM = 1
 
const LP_STATUS_COMPLETED_NUM = 2
 
const LP_STATUS_FAILED_NUM = 3
 
const LP_STATUS_REGISTERED = 'trac_registered'
 
const LP_STATUS_NOT_REGISTERED = 'trac_not_registered'
 
const LP_STATUS_PARTICIPATED = 'trac_participated'
 
const LP_STATUS_NOT_PARTICIPATED = 'trac_not_participated'
 
- Static Public Attributes inherited from ilLPStatus
static $list_gui_cache
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent (int $a_obj_id, int $a_usr_id, int $a_status, int $a_old_status, int $a_percentage)
 
static _lookupStatusForObject (int $a_obj_id, int $a_status, ?array $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects (int $a_user_id, array $a_obj_ids, int $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects (array $a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects (int $a_user_id, array $a_obj_ids)
 Get LP status for given objects (and user) More...
 
- Protected Attributes inherited from ilLPStatus
int $obj_id
 
ilDBInterface $db
 
ilObjectDataCache $ilObjDataCache
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLPStatusCourseReference::__construct ( int  $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 34 of file class.ilLPStatusCourseReference.php.

35 {
36 global $DIC;
37
38 parent::__construct($a_obj_id);
39 $this->readTargetObjId($a_obj_id);
40 $this->readStatusInfo($a_obj_id);
41 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), readStatusInfo(), and readTargetObjId().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getCompleted()

static ilLPStatusCourseReference::_getCompleted ( int  $a_obj_id)
static

Parameters
int$a_obj_id
Returns
int[]

Reimplemented from ilLPStatus.

Definition at line 107 of file class.ilLPStatusCourseReference.php.

107 : array
108 {
109 $self = self::getInstanceByObjId($a_obj_id);
110 return $self->getCompleted();
111 }
static getInstanceByObjId(int $a_reference_obj_id)

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getCountCompleted()

static ilLPStatusCourseReference::_getCountCompleted ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 98 of file class.ilLPStatusCourseReference.php.

98 : int
99 {
100 $self = self::getInstanceByObjId($a_obj_id);
101 return count($self->getCompleted());
102 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getCountInProgress()

static ilLPStatusCourseReference::_getCountInProgress ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 72 of file class.ilLPStatusCourseReference.php.

72 : int
73 {
74 $self = self::getInstanceByObjId($a_obj_id);
75 return count($self->getInProgress());
76 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getCountNotAttempted()

static ilLPStatusCourseReference::_getCountNotAttempted ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 46 of file class.ilLPStatusCourseReference.php.

46 : int
47 {
48 $self = self::getInstanceByObjId($a_obj_id);
49 return count($self->getNotAttempted());
50 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getInProgress()

static ilLPStatusCourseReference::_getInProgress ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 81 of file class.ilLPStatusCourseReference.php.

81 : array
82 {
83 $self = self::getInstanceByObjId($a_obj_id);
84 return $self->getInProgress();
85 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getNotAttempted()

static ilLPStatusCourseReference::_getNotAttempted ( int  $a_obj_id)
static

Parameters
int$a_obj_id
Returns
int[]

Reimplemented from ilLPStatus.

Definition at line 55 of file class.ilLPStatusCourseReference.php.

55 : array
56 {
57 $self = self::getInstanceByObjId($a_obj_id);
58 return $self->getNotAttempted();
59 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ _getStatusInfo()

static ilLPStatusCourseReference::_getStatusInfo ( int  $a_obj_id)
static

Reimplemented from ilLPStatus.

Definition at line 124 of file class.ilLPStatusCourseReference.php.

124 : array
125 {
126 $self = self::getInstanceByObjId($a_obj_id);
127 return $self->getStatusInfo();
128 }

References getInstanceByObjId().

+ Here is the call graph for this function:

◆ determineStatus()

ilLPStatusCourseReference::determineStatus ( int  $a_obj_id,
int  $a_usr_id,
?object  $a_obj = null 
)

Reimplemented from ilLPStatus.

Definition at line 167 of file class.ilLPStatusCourseReference.php.

171 : int {
173 $this->target_obj_id,
174 $a_usr_id,
175 false
176 );
177 if ($status) {
178 return $status;
179 }
180 return \ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM;
181 }
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.

◆ getCompleted()

ilLPStatusCourseReference::getCompleted ( )
Returns
int[]

Definition at line 116 of file class.ilLPStatusCourseReference.php.

117 {
118 return $this->status_info[\ilLPStatus::LP_STATUS_COMPLETED_NUM];
119 }
const LP_STATUS_COMPLETED_NUM

References ilLPStatus\LP_STATUS_COMPLETED_NUM.

◆ getInProgress()

ilLPStatusCourseReference::getInProgress ( )
Returns
int[]

Definition at line 90 of file class.ilLPStatusCourseReference.php.

91 {
92 return $this->status_info[\ilLPStatus::LP_STATUS_IN_PROGRESS_NUM];
93 }
const LP_STATUS_IN_PROGRESS_NUM

References ilLPStatus\LP_STATUS_IN_PROGRESS_NUM.

◆ getInstanceByObjId()

static ilLPStatusCourseReference::getInstanceByObjId ( int  $a_reference_obj_id)
staticprivate

Definition at line 183 of file class.ilLPStatusCourseReference.php.

186 if (!isset(self::$instances[$a_reference_obj_id])) {
187 self::$instances[$a_reference_obj_id] = new self(
188 $a_reference_obj_id
189 );
190 }
191 return self::$instances[$a_reference_obj_id];
192 }
Class ilLPStatusCourseReference.

Referenced by _getCompleted(), _getCountCompleted(), _getCountInProgress(), _getCountNotAttempted(), _getInProgress(), _getNotAttempted(), and _getStatusInfo().

+ Here is the caller graph for this function:

◆ getNotAttempted()

ilLPStatusCourseReference::getNotAttempted ( )
Returns
int[]

Definition at line 64 of file class.ilLPStatusCourseReference.php.

65 {
66 return $this->status_info[\ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM];
67 }
const LP_STATUS_NOT_ATTEMPTED_NUM

References ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

◆ getStatusInfo()

ilLPStatusCourseReference::getStatusInfo ( )

Definition at line 130 of file class.ilLPStatusCourseReference.php.

References $status_info.

◆ readStatusInfo()

ilLPStatusCourseReference::readStatusInfo ( int  $a_obj_id)

Definition at line 138 of file class.ilLPStatusCourseReference.php.

138 : void
139 {
140 global $DIC;
141
142 $database = $DIC->database();
143 $query = 'select status,usr_id from ut_lp_marks ' .
144 'where obj_id = ' . $database->quote(
145 $this->target_obj_id,
147 );
148 $res = $database->query($query);
149
150 $info = [
155 ];
156 while ($row = $res->fetchRow(\ilDBConstants::FETCHMODE_OBJECT)) {
157 if (array_key_exists((int) $row->status, $info)) {
158 $info[(int) $row->status][] = (int) $row->usr_id;
159 }
160 }
161 $this->status_info = $info;
162 }
const LP_STATUS_FAILED_NUM
$info
Definition: entry_point.php:21
$res
Definition: ltiservices.php:69

References $DIC, $info, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, and ilDBConstants\T_INTEGER.

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readTargetObjId()

ilLPStatusCourseReference::readTargetObjId ( int  $a_obj_id)
private

Definition at line 194 of file class.ilLPStatusCourseReference.php.

194 : void
195 {
196 $this->target_obj_id = ilObject::_lookupObjId(
198 );
199 }
static _lookupTargetRefId(int $a_obj_id)
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId(), and ilContainerReference\_lookupTargetRefId().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $instances

ilLPStatusCourseReference::$instances = []
staticprivate

Definition at line 29 of file class.ilLPStatusCourseReference.php.

◆ $status_info

array ilLPStatusCourseReference::$status_info = []
private

Definition at line 32 of file class.ilLPStatusCourseReference.php.

Referenced by getStatusInfo().

◆ $target_obj_id

int ilLPStatusCourseReference::$target_obj_id = 0
private

Definition at line 31 of file class.ilLPStatusCourseReference.php.


The documentation for this class was generated from the following file: