ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPStatusCollectionTLT Class Reference
+ Inheritance diagram for ilLPStatusCollectionTLT:
+ Collaboration diagram for ilLPStatusCollectionTLT:

Public Member Functions

 _getInProgress ($a_obj_id)
 _getCompleted ($a_obj_id)
 _getStatusInfo ($a_obj_id, $a_include_tlt_data=false)
 determineStatus ($a_obj_id, $a_user_id, $a_obj=null)
 Determine status.
- Public Member Functions inherited from ilLPStatus
 ilLPStatus ($a_obj_id)
 _getCountNotAttempted ($a_obj_id)
 _getNotAttempted ($a_obj_id)
 _getCountInProgress ($a_obj_id)
 _getCountCompleted ($a_obj_id)
 _getFailed ($a_obj_id)
 _getCountFailed ()
 _getStatusInfo ($a_obj_id)
 _getTypicalLearningTime ($a_obj_id)
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
 New status handling (st: status, nr: accesses, p: percentage, t: time spent, m: mark)
 determinePercentage ($a_obj_id, $a_usr_id, $a_obj=null)
 Determine percentage.
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh status.
 _lookupStatusChanged ($a_obj_id, $a_user_id)
 Lookup status changed.

Additional Inherited Members

- Static Public Member Functions inherited from ilLPStatus
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.
static writeStatus ($a_obj_id, $a_user_id, $a_status, $a_percentage=false, $a_force_per=false)
 Write status for user and object.
static setInProgressIfNotAttempted ($a_obj_id, $a_user_id)
 This function shoudl be clalled for normal "read events".
static setAllDirty ()
 Sets all status to dirty.
static setDirty ($a_obj_id)
 Sets status of an object to dirty.
static _lookupStatus ($a_obj_id, $a_user_id, $a_create=true)
 Lookup status.
static _lookupPercentage ($a_obj_id, $a_user_id)
 Lookup percentage.
static _hasUserCompleted ($a_obj_id, $a_user_id)
 Lookup user object completion.
static _lookupCompletedForObject ($a_obj_id, $a_user_ids=null)
 Get completed users for object.
static _lookupFailedForObject ($a_obj_id, $a_user_ids=null)
 Get failed users for object.
static _lookupInProgressForObject ($a_obj_id, $a_user_ids=null)
 Get in progress users for object.
static preloadListGUIData ($a_obj_ids)
static getListGUIStatus ($a_obj_id)
- Data Fields inherited from ilLPStatus
 $obj_id = null
 $db = null
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 Member Functions inherited from ilLPStatus
 raiseEvent ($a_obj_id, $a_usr_id, $a_status, $a_percentage)
- Static Protected Member Functions inherited from ilLPStatus
static _lookupStatusForObject ($a_obj_id, $a_status, $a_user_ids=null)
 Get users with given status for object.

Detailed Description

Definition at line 15 of file class.ilLPStatusCollectionTLT.php.

Member Function Documentation

ilLPStatusCollectionTLT::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 36 of file class.ilLPStatusCollectionTLT.php.

References _getStatusInfo().

{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$counter = 0;
$users = array();
foreach($status_info['items'] as $item_id)
{
$tmp_users = $status_info['completed'][$item_id];
if(!$counter++)
{
$users = $tmp_users;
}
else
{
$users = array_intersect($users,$tmp_users);
}
}
$users = array_unique($users);
return $users;
}

+ Here is the call graph for this function:

ilLPStatusCollectionTLT::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References ilLPStatusWrapper\_getCompleted(), and _getStatusInfo().

{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$users = array();
if(is_array($status_info['in_progress']))
{
foreach($status_info['in_progress'] as $in_progress)
{
$users = array_merge($users,$in_progress);
}
$users = array_unique($users);
}
$users = array_diff($users,ilLPStatusWrapper::_getCompleted($a_obj_id));
return $users;
}

+ Here is the call graph for this function:

ilLPStatusCollectionTLT::_getStatusInfo (   $a_obj_id,
  $a_include_tlt_data = false 
)

Definition at line 60 of file class.ilLPStatusCollectionTLT.php.

References $ilDB, $ref_id, $row, ilObject\_getAllReferences(), ilMDEducational\_getTypicalLearningTimeSeconds(), and ilObjectLP\getInstance().

Referenced by _getCompleted(), _getInProgress(), and determineStatus().

{
global $ilDB;
$status_info = array();
include_once "Services/Object/classes/class.ilObjectLP.php";
$olp = ilObjectLP::getInstance($a_obj_id);
$collection = $olp->getCollectionInstance();
if($collection)
{
$status_info["items"] = $collection->getItems($a_obj_id);
include_once './Services/MetaData/classes/class.ilMDEducational.php';
foreach($status_info["items"] as $item_id)
{
$status_info["in_progress"][$item_id] = array();
$status_info["completed"][$item_id] = array();
$status_info["tlt"][$item_id] = ilMDEducational::_getTypicalLearningTimeSeconds($a_obj_id, $item_id);
}
$ref_ids = ilObject::_getAllReferences($a_obj_id);
$ref_id = end($ref_ids);
$possible_items = $collection->getPossibleItems($ref_id);
$chapter_ids = array_intersect(array_keys($possible_items),
$status_info["items"]);
// fix order (adapt from possible items)
$status_info["items"] = $chapter_ids;
if($chapter_ids)
{
foreach($chapter_ids as $item_id)
{
$status_info["item_titles"][$item_id] = $possible_items[$item_id]["title"];
}
$set = $ilDB->query("SELECT obj_id,usr_id,spent_seconds".
" FROM lm_read_event".
" WHERE ".$ilDB->in("obj_id", $chapter_ids, "", "integer"));
while($row = $ilDB->fetchAssoc($set))
{
if($row["spent_seconds"] < $status_info["tlt"][$row["obj_id"]])
{
$status_info["in_progress"][$row["obj_id"]][] = $row["usr_id"];
}
else
{
$status_info["completed"][$row["obj_id"]][] = $row["usr_id"];
}
if($a_include_tlt_data)
{
$status_info["tlt_users"][$row["obj_id"]][$row["usr_id"]] = $row["spent_seconds"];
}
}
}
}
if(!$a_include_tlt_data)
{
unset($status_info["tlt"]);
}
return $status_info;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusCollectionTLT::determineStatus (   $a_obj_id,
  $a_usr_id,
  $a_obj = null 
)

Determine status.

Parameters
@return

Reimplemented from ilLPStatus.

Definition at line 128 of file class.ilLPStatusCollectionTLT.php.

References _getStatusInfo(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

{
$info = self::_getStatusInfo($a_obj_id);
$completed_once = false;
if(is_array($info["completed"]))
{
$completed = true;
foreach($info["completed"] as $user_ids)
{
// must have completed all items to complete collection
if(!in_array($a_user_id, $user_ids))
{
$completed = false;
break;
}
else
{
$completed_once = true;
}
}
if($completed)
{
}
}
// #14997
if($completed_once)
{
}
if(is_array($info["in_progress"]))
{
foreach($info["in_progress"] as $user_ids)
{
if(in_array($a_user_id, $user_ids))
{
}
}
}
}

+ Here is the call graph for this function:


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