ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLPStatusSCORM Class Reference
+ Inheritance diagram for ilLPStatusSCORM:
+ Collaboration diagram for ilLPStatusSCORM:

Public Member Functions

 ilLPStatusSCORM ($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.
 determinePercentage ($a_obj_id, $a_user_id, $a_obj=null)
 Determine percentage.
- 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)
 _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)
 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.ilLPStatusSCORM.php.

Member Function Documentation

ilLPStatusSCORM::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References $ilDB, ilLPStatusWrapper\_getFailed(), and _getStatusInfo().

{
global $ilDB;
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$items = $status_info['scos'];
$counter = 0;
$users = array();
foreach($items as $sco_id)
{
$tmp_users = $status_info['completed'][$sco_id];
if(!$counter++)
{
$users = $tmp_users;
}
else
{
$users = array_intersect($users,$tmp_users);
}
}
$users = array_diff($users,ilLPStatusWrapper::_getFailed($a_obj_id));
return $users;
}

+ Here is the call graph for this function:

ilLPStatusSCORM::_getFailed (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 96 of file class.ilLPStatusSCORM.php.

References _getStatusInfo().

{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
if(!count($status_info['scos']))
{
return array();
}
$users = array();
foreach($status_info['scos'] as $sco_id)
{
$users = array_merge($users,(array) $status_info['failed'][$sco_id]);
}
return array_unique($users);
}

+ Here is the call graph for this function:

ilLPStatusSCORM::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 47 of file class.ilLPStatusSCORM.php.

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

{
include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
$users = array();
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));
$users = array_diff($users,ilLPStatusWrapper::_getFailed($a_obj_id));
return $users;
}

+ Here is the call graph for this function:

ilLPStatusSCORM::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 113 of file class.ilLPStatusSCORM.php.

References ilSCORM2004Tracking\_getCountCompletedPerUser(), ilObjSCORMTracking\_getCountCompletedPerUser(), ilSCORM2004Tracking\_getItemProgressInfo(), ilLPCollectionCache\_getItems(), ilObjSCORMTracking\_getProgressInfo(), ilObjAICCLearningModule\_getTrackingItems(), ilObjSCORM2004LearningModule\_lookupItemTitle(), ilObjSAHSLearningModule\_lookupSubType(), and ilSCORMItem\_lookupTitle().

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

{
// Which sco's determine the status
include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
$status_info['scos'] = ilLPCollectionCache::_getItems($a_obj_id);
$status_info['num_scos'] = count($status_info['scos']);
// Get subtype
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
$status_info['subtype'] = ilObjSAHSLearningModule::_lookupSubType($a_obj_id);
switch($status_info['subtype'])
{
case 'hacp':
case 'aicc':
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$status_info['num_completed'] = ilObjSCORMTracking::_getCountCompletedPerUser($status_info['scos'],$a_obj_id);
include_once './Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
foreach(ilObjAICCLearningModule::_getTrackingItems($a_obj_id) as $item)
{
if(in_array($item['obj_id'],$status_info['scos']))
{
$status_info['scos_title']["$item[obj_id]"] = $item['title'];
}
}
$info = ilObjSCORMTracking::_getProgressInfo($status_info['scos'],$a_obj_id);
break;
case 'scorm':
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$status_info['num_completed'] = ilObjSCORMTracking::_getCountCompletedPerUser($status_info['scos'],$a_obj_id);
include_once './Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
foreach($status_info['scos'] as $sco_id)
{
$status_info['scos_title'][$sco_id] = ilSCORMItem::_lookupTitle($sco_id);
}
$info = ilObjSCORMTracking::_getProgressInfo($status_info['scos'],$a_obj_id);
break;
case "scorm2004":
include_once './Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php';
$status_info['num_completed'] = ilSCORM2004Tracking::_getCountCompletedPerUser($status_info['scos'],$a_obj_id,true);
include_once './Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
foreach($status_info['scos'] as $sco_id)
{
$status_info['scos_title'][$sco_id] = ilObjSCORM2004LearningModule::_lookupItemTitle($sco_id);
}
$info = ilSCORM2004Tracking::_getItemProgressInfo($status_info['scos'],$a_obj_id,true);
break;
}
$status_info['completed'] = array();
$status_info['failed'] = array();
$status_info['in_progress'] = array();
foreach($status_info['scos'] as $sco_id)
{
$status_info['completed'][$sco_id] = $info['completed'][$sco_id] ? $info['completed'][$sco_id] : array();
$status_info['failed'][$sco_id] = $info['failed'][$sco_id] ? $info['failed'][$sco_id] : array();
$status_info['in_progress'][$sco_id] = $info['in_progress'][$sco_id] ? $info['in_progress'][$sco_id] : array();
}
//var_dump($status_info["completed"]);
return $status_info;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusSCORM::determinePercentage (   $a_obj_id,
  $a_user_id,
  $a_obj = null 
)

Determine percentage.

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

Reimplemented from ilLPStatus.

Definition at line 249 of file class.ilLPStatusSCORM.php.

References ilSCORM2004Tracking\_countCompleted(), ilObjSCORMTracking\_countCompleted(), ilLPCollectionCache\_getItems(), and ilObjSAHSLearningModule\_lookupSubType().

{
// Which sco's determine the status
include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
$scos = ilLPCollectionCache::_getItems($a_obj_id);
$reqscos = count($scos);
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
if ($subtype != "scorm2004")
{
include_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
$compl = ilObjSCORMTracking::_countCompleted($scos, $a_obj_id, $a_user_id);
}
else
{
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
$compl = ilSCORM2004Tracking::_countCompleted($scos, $a_obj_id, $a_user_id, true);
}
if ($reqscos > 0)
{
$per = min(100, 100 / $reqscos * $compl);
}
else
{
$per = 100;
}
return $per;
}

+ Here is the call graph for this function:

ilLPStatusSCORM::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 189 of file class.ilLPStatusSCORM.php.

References $failed, $ilDB, $ilLog, ilSCORM2004Tracking\_getCollectionStatus(), ilObjSCORMTracking\_getCollectionStatus(), ilLPCollectionCache\_getItems(), ilObjSAHSLearningModule\_lookupSubType(), ilChangeEvent\hasAccessed(), LP_STATUS_COMPLETED_NUM, LP_STATUS_FAILED_NUM, LP_STATUS_IN_PROGRESS_NUM, and LP_STATUS_NOT_ATTEMPTED_NUM.

{
global $ilObjDataCache, $ilDB, $ilLog;
// if the user has accessed the scorm object
// the status is at least "in progress"
include_once("./Services/Tracking/classes/class.ilChangeEvent.php");
if (ilChangeEvent::hasAccessed($a_obj_id, $a_user_id))
{
}
//$ilLog->write("-".$status."-");
// Which sco's determine the status
include_once './Services/Tracking/classes/class.ilLPCollectionCache.php';
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
$scos = ilLPCollectionCache::_getItems($a_obj_id);
$completed = true;
$failed = false;
switch($subtype)
{
case 'hacp':
case 'aicc':
case 'scorm':
include_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
$scorm_status = ilObjSCORMTracking::_getCollectionStatus($scos, $a_obj_id, $a_user_id);
break;
case 'scorm2004':
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
$scorm_status = ilSCORM2004Tracking::_getCollectionStatus($scos, $a_obj_id, $a_user_id);
break;
}
switch ($scorm_status)
{
case "in_progress":
break;
case "completed":
break;
case "failed":
break;
}
//$ilLog->write("-".$status."-");
return $status;
}

+ Here is the call graph for this function:

ilLPStatusSCORM::ilLPStatusSCORM (   $a_obj_id)

Definition at line 38 of file class.ilLPStatusSCORM.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: