ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLTIConsumerLPStatus Class Reference
+ Inheritance diagram for ilLTIConsumerLPStatus:
+ Collaboration diagram for ilLTIConsumerLPStatus:

Static Public Member Functions

static getLPStatusDataFromDb ($a_obj_id, $a_status)
 Get the LP status data directly from the database table This can be called from ilLTIConsumer::getLP* methods avoiding loops. More...
 
static getLPDataForUserFromDb ($a_obj_id, $a_user_id)
 Get the LP data directly from the database table This can be called from ilLTIConsumer::getLP* methods avoiding loops. More...
 
static trackAccess ($a_user_id, $a_obj_id, $a_ref_id)
 Track read access to the object Prevents a call of determineStatus() that would return "not attempted". More...
 
static trackResult ($a_user_id, $a_obj_id, $a_status=self::LP_STATUS_IN_PROGRESS_NUM, $a_percentage)
 Track result from the LTI Consumer. More...
 
- Static Public Member Functions inherited from ilLPStatus
static _getCountNotAttempted ($a_obj_id)
 
static _getNotAttempted ($a_obj_id)
 
static _getCountInProgress ($a_obj_id)
 
static _getInProgress ($a_obj_id)
 
static _getCountCompleted ($a_obj_id)
 
static _getCompleted ($a_obj_id)
 
static _getFailed ($a_obj_id)
 
static _getCountFailed ()
 
static _getStatusInfo ($a_obj_id)
 
static _getTypicalLearningTime ($a_obj_id)
 
static checkStatusForObject ($a_obj_id, $a_users=false)
 This function checks whether the status for a given number of users is dirty and must be recalculated. More...
 
static writeStatus ($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false, &$a_old_status=self::LP_STATUS_NOT_ATTEMPTED_NUM)
 Write status for user and object. More...
 
static setInProgressIfNotAttempted ($a_obj_id, $a_user_id)
 This function shoudl be clalled for normal "read events". More...
 
static setAllDirty ()
 Sets all status to dirty. More...
 
static setDirty ($a_obj_id)
 Sets status of an object to dirty. More...
 
static _lookupStatus ($a_obj_id, $a_user_id, $a_create=true)
 Lookup status. More...
 
static _lookupPercentage ($a_obj_id, $a_user_id)
 Lookup percentage. More...
 
static _hasUserCompleted ($a_obj_id, $a_user_id)
 Lookup user object completion. More...
 
static _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed. More...
 
static _lookupCompletedForObject ($a_obj_id, $a_user_ids=null)
 Get completed users for object. More...
 
static _lookupFailedForObject ($a_obj_id, $a_user_ids=null)
 Get failed users for object. More...
 
static _lookupInProgressForObject ($a_obj_id, $a_user_ids=null)
 Get in progress users for object. More...
 
static preloadListGUIData ($a_obj_ids)
 
static getListGUIStatus ($a_obj_id, $a_image_only=true)
 

Static Protected Member Functions

static raiseEventStatic ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
 Static version if ilLPStatus::raiseEvent This function is just a workaround for PHP7 until ilLPStatus::raiseEvent is declared as static. More...
 
- Static Protected Member Functions inherited from ilLPStatus
static raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_old_status, $a_percentage)
 
static _lookupStatusForObject ($a_obj_id, $a_status, $a_user_ids=null)
 Get users with given status for object. More...
 
static validateLPForObjects ($a_user_id, $a_obj_ids, $a_parent_ref_id)
 Process given objects for lp-relevance. More...
 
static checkLPModesForObjects ($a_obj_ids, array &$a_coll_obj_ids)
 Process lp modes for given objects. More...
 
static getLPStatusForObjects ($a_user_id, $a_obj_ids)
 Get LP status for given objects (and user) More...
 

Additional Inherited Members

- Public Member Functions inherited from ilLPStatus
 __construct ($a_obj_id)
 
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark) More...
 
 determinePercentage ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine percentage. More...
 
 determineStatus ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine status. More...
 
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh status. More...
 
- 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
 
- Protected Attributes inherited from ilLPStatus
 $obj_id = null
 
 $db = null
 

Detailed Description

Definition at line 17 of file class.ilLTIConsumerLPStatus.php.

Member Function Documentation

◆ getLPDataForUserFromDb()

static ilLTIConsumerLPStatus::getLPDataForUserFromDb (   $a_obj_id,
  $a_user_id 
)
static

Get the LP data directly from the database table This can be called from ilLTIConsumer::getLP* methods avoiding loops.

Parameters
$a_obj_id
$a_user_id
Returns
int

Definition at line 40 of file class.ilLTIConsumerLPStatus.php.

41  {
42  return self::getLPDataForUser($a_obj_id, $a_user_id);
43  }

◆ getLPStatusDataFromDb()

static ilLTIConsumerLPStatus::getLPStatusDataFromDb (   $a_obj_id,
  $a_status 
)
static

Get the LP status data directly from the database table This can be called from ilLTIConsumer::getLP* methods avoiding loops.

Parameters
$a_obj_id
$a_status
Returns
mixed

Definition at line 27 of file class.ilLTIConsumerLPStatus.php.

28  {
29  return self::getLPStatusData($a_obj_id, $a_status);
30  }

◆ raiseEventStatic()

static ilLTIConsumerLPStatus::raiseEventStatic (   $a_obj_id,
  $a_usr_id,
  $a_status,
  $a_percentage 
)
staticprotected

Static version if ilLPStatus::raiseEvent This function is just a workaround for PHP7 until ilLPStatus::raiseEvent is declared as static.

Parameters
$a_obj_id
$a_usr_id
$a_status
$a_percentage

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

References $DIC.

99  {
100  global $DIC; /* @var \ILIAS\DI\Container $DIC */
101 
102  $DIC->event()->raise("Services/Tracking", "updateStatus", array(
103  "obj_id" => $a_obj_id,
104  "usr_id" => $a_usr_id,
105  "status" => $a_status,
106  "percentage" => $a_percentage
107  ));
108  }
global $DIC
Definition: goto.php:24

◆ trackAccess()

static ilLTIConsumerLPStatus::trackAccess (   $a_user_id,
  $a_obj_id,
  $a_ref_id 
)
static

Track read access to the object Prevents a call of determineStatus() that would return "not attempted".

See also
ilLearningProgress::_tracProgress()
Parameters
$a_user_id
$a_obj_id
$a_ref_id
string$a_obj_type

Definition at line 56 of file class.ilLTIConsumerLPStatus.php.

References ilChangeEvent\_recordReadEvent().

57  {
58  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
59  ilChangeEvent::_recordReadEvent('xxco', $a_ref_id, $a_obj_id, $a_user_id);
60 
61  $status = self::getLPDataForUser($a_obj_id, $a_user_id);
62  if ($status == self::LP_STATUS_NOT_ATTEMPTED_NUM) {
63  self::writeStatus($a_obj_id, $a_user_id, self::LP_STATUS_IN_PROGRESS_NUM);
64  self::raiseEventStatic(
65  $a_obj_id,
66  $a_user_id,
67  self::LP_STATUS_IN_PROGRESS_NUM,
68  self::getPercentageForUser($a_obj_id, $a_user_id)
69  );
70  }
71  }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
+ Here is the call graph for this function:

◆ trackResult()

static ilLTIConsumerLPStatus::trackResult (   $a_user_id,
  $a_obj_id,
  $a_status = self::LP_STATUS_IN_PROGRESS_NUM,
  $a_percentage 
)
static

Track result from the LTI Consumer.

Parameters
$a_user_id
$a_obj_id
$a_status
$a_percentage
Deprecated:

Definition at line 83 of file class.ilLTIConsumerLPStatus.php.

84  {
85  self::writeStatus($a_obj_id, $a_user_id, $a_status, $a_percentage, true);
86  self::raiseEventStatic($a_obj_id, $a_user_id, $a_status, $a_percentage);
87  }

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