ILIAS  Release_4_4_x_branch Revision 61816
 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, $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)
 refreshStatus ($a_obj_id, $a_users=null)
 Refresh 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.
static _lookupStatus ($a_obj_id, $a_user_id)
 Lookup status.
static _hasUserCompleted ($a_obj_id, $a_user_id)
 Lookup user object completion.
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 preloadListGUIData ($a_obj_ids)
static getListGUIStatus ($a_obj_id)
- 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)
- 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.

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

References 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 72 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().

{
$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 119 of file class.ilLPStatusSCORM.php.

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

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

{
// Which sco's determine the status
include_once './Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$collection = $olp->getCollectionInstance();
if($collection)
{
$status_info['scos'] = $collection->getItems();
}
else
{
$status_info['scos'] = array();
}
$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 271 of file class.ilLPStatusSCORM.php.

References ilSCORM2004Tracking\_countCompleted(), ilObjSCORMTracking\_countCompleted(), ilObjSAHSLearningModule\_lookupSubType(), and ilObjectLP\getInstance().

{
// Which sco's determine the status
include_once './Services/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$collection = $olp->getCollectionInstance();
if($collection)
{
$scos = $collection->getItems();
$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 203 of file class.ilLPStatusSCORM.php.

References $ilLog, ilSCORM2004Tracking\_getCollectionStatus(), ilObjSCORMTracking\_getCollectionStatus(), ilObjSAHSLearningModule\_lookupSubType(), ilObjectLP\getInstance(), ilChangeEvent\hasAccessed(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\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/Object/classes/class.ilObjectLP.php';
$olp = ilObjectLP::getInstance($a_obj_id);
$collection = $olp->getCollectionInstance();
if($collection)
{
$scos = $collection->getItems();
if(sizeof($scos)) // #15462 (#11513 - empty collections cannot be completed)
{
include_once './Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
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 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 308 of file class.ilLPStatusSCORM.php.

References $failed, $usr_id, _getCompleted(), _getFailed(), _getInProgress(), ilSCORM2004Tracking\_getTrackedUsers(), ilObjSCORMTracking\_getTrackedUsers(), ilObjSAHSLearningModule\_lookupSubType(), 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)
{
// this will update any (parent) collections if necessary
ilLPStatus::writeStatus($a_obj_id, $usr_id, self::LP_STATUS_NOT_ATTEMPTED_NUM, 0);
}
}
}

+ Here is the call graph for this function:


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