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

Public Member Functions

 ilLPStatusObjectives ($a_obj_id)
 _getNotAttempted ($a_obj_id)
 _getInProgress ($a_obj_id)
 _getCompleted ($a_obj_id)
 _getFailed ($a_obj_id)
 _getStatusInfo ($a_obj_id)
 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)
 _getCountInProgress ($a_obj_id)
 _getCountCompleted ($a_obj_id)
 _getCountFailed ()
 _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.

Static Public Member Functions

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 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 preloadListGUIData ($a_obj_ids)
static getListGUIStatus ($a_obj_id)

Static Protected Member Functions

static getMembers ($a_obj_id)
 Get members for object.
- 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.

Additional Inherited Members

- 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)

Detailed Description

Definition at line 16 of file class.ilLPStatusObjectives.php.

Member Function Documentation

ilLPStatusObjectives::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 66 of file class.ilLPStatusObjectives.php.

References _getStatusInfo().

{
$objective_results = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$usr_ids = (array)$objective_results['user_status'][self::LP_STATUS_COMPLETED_NUM];
if($usr_ids)
{
// Exclude all non members
$usr_ids = array_intersect(self::getMembers($a_obj_id), (array)$usr_ids);
}
return $usr_ids ? $usr_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getFailed (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 80 of file class.ilLPStatusObjectives.php.

References _getStatusInfo().

{
$objective_results = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$usr_ids = (array)$objective_results['user_status'][self::LP_STATUS_FAILED_NUM];
if($usr_ids)
{
// Exclude all non members
$usr_ids = array_intersect(self::getMembers($a_obj_id), (array)$usr_ids);
}
return $usr_ids ? $usr_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 43 of file class.ilLPStatusObjectives.php.

References _getStatusInfo().

{
$objective_results = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$usr_ids = (array)$objective_results['user_status'][self::LP_STATUS_IN_PROGRESS_NUM];
/* change_event is of no use when no objective has been tried yet
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
$users = ilChangeEvent::lookupUsersInProgress($a_obj_id);
// Exclude all users with status completed/failed.
$users = array_diff((array) $users,ilLPStatusWrapper::_getCompleted($a_obj_id));
$users = array_diff((array) $users,ilLPStatusWrapper::_getFailed($a_obj_id));
*/
if($usr_ids)
{
// Exclude all non members
$usr_ids = array_intersect(self::getMembers($a_obj_id), (array)$usr_ids);
}
return $usr_ids ? $usr_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getNotAttempted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getFailed(), ilLPStatusWrapper\_getInProgress(), and getMembers().

{
$users = array();
$members = self::getMembers($a_obj_id);
if($members)
{
// diff in progress, completed and failed (use stored result in LPStatusWrapper)
$users = array_diff((array) $members, ilLPStatusWrapper::_getInProgress($a_obj_id));
$users = array_diff((array) $members, ilLPStatusWrapper::_getCompleted($a_obj_id));
$users = array_diff((array) $members, ilLPStatusWrapper::_getFailed($a_obj_id));
}
return $users;
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 94 of file class.ilLPStatusObjectives.php.

References $ilDB, $in, $query, $res, $row, ilCourseObjective\_getObjectiveIds(), DB_FETCHMODE_OBJECT, and ilLOUserResults\getSummarizedObjectiveStatusForLP().

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

{
global $ilDB;
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
$status_info = array();
$status_info['user_status'] = array();
$status_info['objectives'] = ilCourseObjective::_getObjectiveIds($a_obj_id,true);
$status_info['num_objectives'] = count($status_info['objectives']);
if($status_info['num_objectives'])
{
$in = $ilDB->in('objective_id',$status_info['objectives'],false,'integer');
include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
foreach(ilLOUserResults::getSummarizedObjectiveStatusForLP($status_info['objectives']) as $user_id => $user_status)
{
$status_info['user_status'][$user_status][] = $user_id;
}
// Read title/description
$query = "SELECT * FROM crs_objectives WHERE ".$in;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$status_info['objective_title'][$row->objective_id] = $row->title;
$status_info['objective_description'][$row->objective_id] = $row->description;
}
}
return $status_info;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLPStatusObjectives::_lookupCompletedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get completed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 193 of file class.ilLPStatusObjectives.php.

References ilLPStatus\_lookupStatusForObject(), and getMembers().

{
if(!$a_user_ids)
{
$a_user_ids = self::getMembers($a_obj_id);
if(!$a_user_ids)
{
return array();
}
}
return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_COMPLETED_NUM, $a_user_ids);
}

+ Here is the call graph for this function:

static ilLPStatusObjectives::_lookupFailedForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get failed users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 213 of file class.ilLPStatusObjectives.php.

{
return array();
}
static ilLPStatusObjectives::_lookupInProgressForObject (   $a_obj_id,
  $a_user_ids = null 
)
static

Get in progress users for object.

Parameters
int$a_obj_id
array$a_user_ids
Returns
array

Reimplemented from ilLPStatus.

Definition at line 225 of file class.ilLPStatusObjectives.php.

References ilLPStatus\_lookupStatusForObject(), and getMembers().

{
if(!$a_user_ids)
{
$a_user_ids = self::getMembers($a_obj_id);
if(!$a_user_ids)
{
return array();
}
}
return self::_lookupStatusForObject($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM, $a_user_ids);
}

+ Here is the call graph for this function:

ilLPStatusObjectives::determineStatus (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine status.

Parameters
integerobject id
integeruser id
objectobject (optional depends on object type)
Returns
integer status

Reimplemented from ilLPStatus.

Definition at line 136 of file class.ilLPStatusObjectives.php.

References $ilDB, ilCourseObjective\_getObjectiveIds(), ilLOUserResults\getSummarizedObjectiveStatusForLP(), ilChangeEvent\hasAccessed(), and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

{
global $ilObjDataCache, $ilDB;
// the status completed depends on:
// $status_info['num_objectives'] (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
// - ilCourseObjective::_getObjectiveIds($a_obj_id);
// - table crs_objectives manipulated in
// - ilCourseObjective
// $status_info['objective_result'] (ilLPStatusWrapper::_getStatusInfo($a_obj_id);)
// table crs_objective_status (must not contain a dataset)
// ilCourseObjectiveResult -> added ilLPStatusWrapper::_updateStatus()
switch ($ilObjDataCache->lookupType($a_obj_id))
{
case "crs":
include_once("./Services/Tracking/classes/class.ilChangeEvent.php");
if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id))
{
// change_event is of no use when no objective has been tried
// $status = self::LP_STATUS_IN_PROGRESS_NUM;
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
$objectives = ilCourseObjective::_getObjectiveIds($a_obj_id, true);
if ($objectives)
{
// #14051 - getSummarizedObjectiveStatusForLP() might return null
include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
$status = (int)ilLOUserResults::getSummarizedObjectiveStatusForLP($objectives, $a_user_id);
}
}
break;
}
return $status;
}

+ Here is the call graph for this function:

static ilLPStatusObjectives::getMembers (   $a_obj_id)
staticprotected

Get members for object.

Parameters
int$a_obj_id
Returns
array

Definition at line 179 of file class.ilLPStatusObjectives.php.

References ilCourseParticipants\_getInstanceByObjId().

Referenced by _getNotAttempted(), _lookupCompletedForObject(), and _lookupInProgressForObject().

{
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
return $member_obj->getMembers();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusObjectives::ilLPStatusObjectives (   $a_obj_id)

Definition at line 19 of file class.ilLPStatusObjectives.php.

References $ilDB, and ilLPStatus\ilLPStatus().

{
global $ilDB;
parent::ilLPStatus($a_obj_id);
$this->db =& $ilDB;
}

+ Here is the call graph for this function:


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