ILIAS  Release_4_1_x_branch Revision 61804
 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)
 _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)
 _getFailed ($a_obj_id)
 _getCountFailed ()
 _getTypicalLearningTime ($a_obj_id)
 _updateStatus ($a_obj_id, $a_usr_id, $a_obj=null)
 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.

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.
- Data Fields inherited from ilLPStatus
 $obj_id = null
 $db = null

Detailed Description

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

Member Function Documentation

ilLPStatusObjectives::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References $ilBench, $ilDB, and _getStatusInfo().

Referenced by _getInProgress().

{
global $ilDB;
global $ilBench;
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
foreach($status_info['objective_result'] as $user_id => $completed)
{
if(count($completed) == $status_info['num_objectives'])
{
$usr_ids[] = $user_id;
}
}
return $usr_ids ? $usr_ids : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusObjectives::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References $ilDB, _getCompleted(), ilCourseParticipants\_getInstanceByObjId(), and ilChangeEvent\lookupUsersInProgress().

{
global $ilDB;
$completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
$members_obj = ilCourseParticipants::_getInstanceByObjId($a_obj_id);
$members = $members_obj->getParticipants();
include_once './Services/Tracking/classes/class.ilChangeEvent.php';
foreach($all as $user_id)
{
if(!in_array($user_id,$completed) and in_array($user_id,$members))
{
$user_ids[] = $user_id;
}
}
return $user_ids ? $user_ids : array();
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getNotAttempted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References $ilBench, ilLPStatusWrapper\_getCompleted(), ilLPStatusWrapper\_getInProgress(), and ilCourseParticipants\_getInstanceByObjId().

{
global $ilObjDataCache;
global $ilBench;
$ilBench->start('LearningProgress','9171_LPStatusObjectives_notAttempted');
include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
$members_obj = ilCourseParticipants::_getInstanceByObjId($a_obj_id);
$members = $members_obj->getParticipants();
// diff in progress and completed (use stored result in LPStatusWrapper)
$users = array_diff($members,$inp = ilLPStatusWrapper::_getInProgress($a_obj_id));
$users = array_diff($users,$com = ilLPStatusWrapper::_getCompleted($a_obj_id));
$ilBench->stop('LearningProgress','9171_LPStatusObjectives_notAttempted');
return $users ? $users : array();
}

+ Here is the call graph for this function:

ilLPStatusObjectives::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

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

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

Referenced by _getCompleted().

{
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
global $ilDB;
$status_info['objective_result'] = array();
$status_info['objectives'] = ilCourseObjective::_getObjectiveIds($a_obj_id);
$status_info['num_objectives'] = count($status_info['objectives']);
if(!$status_info['num_objectives'])
{
return $status_info;
}
else
{
$in = $ilDB->in('objective_id',$status_info['objectives'], false,'integer');
}
$query = "SELECT * FROM crs_objective_status ".
"WHERE ".$in;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$status_info['completed'][$row->objective_id][] = $row->user_id;
$status_info['objective_result'][$row->user_id][$row->objective_id] = $row->objective_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:

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 154 of file class.ilLPStatusObjectives.php.

References $ilDB, ilCourseObjective\_getObjectiveIds(), ilChangeEvent\hasAccessed(), LP_STATUS_COMPLETED_NUM, LP_STATUS_IN_PROGRESS_NUM, and 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":
if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id))
{
include_once 'Modules/Course/classes/class.ilCourseObjective.php';
$objectives = ilCourseObjective::_getObjectiveIds($a_obj_id);
if ($objectives)
{
$set = $ilDB->query("SELECT count(objective_id) cnt FROM crs_objective_status ".
"WHERE ".$ilDB->in('objective_id',$objectives, false,'integer').
" AND user_id = ".$ilDB->quote($a_user_id, "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
if ($rec["cnt"] == count($objectives))
{
}
}
}
}
break;
}
return $status;
}

+ Here is the call graph for this function:

ilLPStatusObjectives::ilLPStatusObjectives (   $a_obj_id)

Definition at line 38 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: