ILIAS  Release_3_10_x_branch Revision 61812
 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)
- 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)

Additional Inherited Members

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

References $ilBench, and _getStatusInfo().

Referenced by _getInProgress().

{
global $ilDB;
global $ilBench;
$ilBench->start('LearningProgress','9173_LPStatusObjectives_completed');
$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;
}
}
$ilBench->stop('LearningProgress','9173_LPStatusObjectives_completed');
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 $res, _getCompleted(), ilCourseParticipants\_getInstanceByObjId(), and DB_FETCHMODE_OBJECT.

{
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();
$query = "SELECT DISTINCT(usr_id) FROM read_event ".
"WHERE obj_id = '".$a_obj_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if(!in_array($row->usr_id,$completed) and in_array($row->usr_id,$members))
{
$user_ids[] = $row->usr_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 109 of file class.ilLPStatusObjectives.php.

References $in, $res, 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 = "objective_id IN('".implode("','",$status_info['objectives'])."') ";
}
$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::ilLPStatusObjectives (   $a_obj_id)

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

References 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: