ILIAS  Release_4_2_x_branch Revision 61807
 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.
 refreshStatus ($a_obj_id)
- 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.
 _lookupStatus ($a_obj_id, $a_user_id)
 Lookup 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.
- Data Fields inherited from ilLPStatus
 $obj_id = null
 $db = null

Detailed Description

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

Member Function Documentation

ilLPStatusSCORM::_getCompleted (   $a_obj_id)

Reimplemented from ilLPStatus.

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

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

Referenced by refreshStatus().

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

+ Here is the caller graph for this function:

ilLPStatusSCORM::_getFailed (   $a_obj_id)

Reimplemented from ilLPStatus.

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

References _getStatusInfo(), ilSCORM2004Tracking\_hasMaxAttempts(), and ilObjSCORMTracking\_hasMaxAttempts().

Referenced by refreshStatus().

{
$status_info = ilLPStatusWrapper::_getStatusInfo($a_obj_id);
if(!count($status_info['scos']))
{
return array();
}
$users = array();
foreach($status_info['scos'] as $sco_id)
{
// max attempts vs. failed
if(sizeof($status_info['in_progress'][$sco_id]))
{
foreach($status_info['in_progress'][$sco_id] as $user_id)
{
if(!in_array($user_id, $status_info['failed'][$sco_id]))
{
switch($status_info["subtype"])
{
case 'hacp':
case 'aicc':
case 'scorm':
include_once './Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php';
$has_max_attempts = ilObjSCORMTracking::_hasMaxAttempts($a_obj_id, $user_id);
break;
case 'scorm2004':
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
$has_max_attempts = ilSCORM2004Tracking::_hasMaxAttempts($a_obj_id, $user_id);
break;
}
if($has_max_attempts)
{
$status_info['failed'][$sco_id][] = $user_id;
}
}
}
}
$users = array_merge($users,(array) $status_info['failed'][$sco_id]);
}
return array_unique($users);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPStatusSCORM::_getInProgress (   $a_obj_id)

Reimplemented from ilLPStatus.

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

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

Referenced by refreshStatus().

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

+ Here is the caller graph for this function:

ilLPStatusSCORM::_getStatusInfo (   $a_obj_id)

Reimplemented from ilLPStatus.

Definition at line 123 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 259 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 199 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 18 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:

ilLPStatusSCORM::refreshStatus (   $a_obj_id)

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

References $failed, $usr_id, _getCompleted(), _getFailed(), _getInProgress(), ilSCORM2004Tracking\_getTrackedUsers(), ilObjSCORMTracking\_getTrackedUsers(), ilObjSAHSLearningModule\_lookupSubType(), LP_STATUS_NOT_ATTEMPTED_NUM, and ilLPStatus\writeStatus().

{
// this is restricted to SCOs in the current collection
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
$in_progress = ilLPStatusWrapper::_getInProgress($a_obj_id);
$completed = ilLPStatusWrapper::_getCompleted($a_obj_id);
$all_active_users = array_unique(array_merge($in_progress, $completed, $failed));
// get all tracked users regardless of SCOs
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
if ($subtype != "scorm2004")
{
include_once("./Modules/ScormAicc/classes/SCORM/class.ilObjSCORMTracking.php");
$all_tracked_users = ilObjSCORMTracking::_getTrackedUsers($a_obj_id);
}
else
{
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Tracking.php");
$all_tracked_users = ilSCORM2004Tracking::_getTrackedUsers($a_obj_id);
}
$not_attempted_users = array_diff($all_tracked_users, $all_active_users);
unset($all_tracked_users);
unset($all_active_users);
// reset all users which have no data for the current SCOs
if($not_attempted_users)
{
foreach($not_attempted_users as $usr_id)
{
}
}
}

+ Here is the call graph for this function:


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