ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSCORM2004Tracking Class Reference

Class ilSCORM2004Tracking. More...

+ Collaboration diagram for ilSCORM2004Tracking:

Public Member Functions

 ilObjSCORM2004Tracking ()
 Constructor public.
 _getInProgress ($scorm_item_id, $a_obj_id)
 _getCompleted ($scorm_item_id, $a_obj_id)
 _getFailed ($scorm_item_id, $a_obj_id)
 _getCountCompletedPerUser ($a_scorm_item_ids, $a_obj_id)
 Get progress of selected scos.
 _getProgressInfo ($a_obj_id)
 Get overall scorm status.
 _getItemProgressInfo ($a_scorm_item_ids, $a_obj_id)

Static Public Member Functions

static _isCompleted ($a_status, $a_satisfied)
static _isInProgress ($a_status, $a_satisfied)
static _isFailed ($a_status, $a_satisfied)

Detailed Description

Member Function Documentation

ilSCORM2004Tracking::_getCompleted (   $scorm_item_id,
  $a_obj_id 
)

Definition at line 77 of file class.ilSCORM2004Tracking.php.

References $ilDB.

{
global $ilDB;
die("Not Implemented: ilSCORM2004Tracking_getCompleted");
/*
if(is_array($scorm_item_id))
{
$where = "WHERE sco_id IN(".implode(",",ilUtil::quoteArray($scorm_item_id)).") ";
}
else
{
$where = "sco_id = ".$ilDB->quote($scorm_item_id)." ";
}
$query = "SELECT DISTINCT(user_id) FROM scorm_tracking ".
$where.
"AND obj_id = ".$ilDB->quote($a_obj_id)." ".
"AND lvalue = 'cmi.core.lesson_status' ".
"AND ( rvalue = 'completed' ".
"OR rvalue = 'passed')";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$user_ids[] = $row->user_id;
}
return $user_ids ? $user_ids : array();
*/
}
ilSCORM2004Tracking::_getCountCompletedPerUser (   $a_scorm_item_ids,
  $a_obj_id 
)

Get progress of selected scos.

Parameters
object$a_scorm_item_ids
object$a_obj_id
Returns

Definition at line 142 of file class.ilSCORM2004Tracking.php.

References $ilDB, $in, $res, and $row.

Referenced by ilLPStatusSCORM\_getStatusInfo().

{
global $ilDB;
$in = $ilDB->in('cp_node.cp_node_id', $a_scorm_item_ids, false, 'integer');
$res = $ilDB->queryF('
SELECT cmi_node.user_id user_id, COUNT(user_id) completed FROM cp_node, cmi_node
WHERE '.$in.'
AND cp_node.cp_node_id = cmi_node.cp_node_id
AND cp_node.slm_id = %s
AND completion_status = %s
GROUP BY cmi_node.user_id',
array('integer', 'text'),
array($a_obj_id, 'completed')
);
while($row = $ilDB->fetchObject($res))
{
$users[$row->user_id] = $row->completed;
}
return $users ? $users : array();
}

+ Here is the caller graph for this function:

ilSCORM2004Tracking::_getFailed (   $scorm_item_id,
  $a_obj_id 
)

Definition at line 107 of file class.ilSCORM2004Tracking.php.

References $ilDB.

{
global $ilDB;
die("Not Implemented: ilSCORM2004Tracking_getFailed");
/*
if(is_array($scorm_item_id))
{
$where = "WHERE sco_id IN('".implode("','",$scorm_item_id)."') ";
}
else
{
$where = "sco_id = '".$scorm_item_id."' ";
}
$query = "SELECT DISTINCT(user_id) FROM scorm_tracking ".
$where.
"AND obj_id = '".$a_obj_id."' ".
"AND lvalue = 'cmi.core.lesson_status' ".
"AND rvalue = 'failed'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$user_ids[] = $row->user_id;
}
return $user_ids ? $user_ids : array();
*/
}
ilSCORM2004Tracking::_getInProgress (   $scorm_item_id,
  $a_obj_id 
)

Definition at line 41 of file class.ilSCORM2004Tracking.php.

{
die("Not Implemented: ilSCORM2004Tracking_getInProgress");
/*
global $ilDB;
if(is_array($scorm_item_id))
{
$where = "WHERE sco_id IN(";
$where .= implode(",",ilUtil::quoteArray($scorm_item_id));
$where .= ") ";
$where .= ("AND obj_id = ".$ilDB->quote($a_obj_id)." ");
}
else
{
$where = "WHERE sco_id = ".$ilDB->quote($scorm_item_id)." ";
$where .= ("AND obj_id = ".$ilDB->quote($a_obj_id)." ");
}
$query = "SELECT user_id,sco_id FROM scorm_tracking ".
$where.
"GROUP BY user_id, sco_id";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$in_progress[$row->sco_id][] = $row->user_id;
}
return is_array($in_progress) ? $in_progress : array();
*/
}
ilSCORM2004Tracking::_getItemProgressInfo (   $a_scorm_item_ids,
  $a_obj_id 
)

Definition at line 207 of file class.ilSCORM2004Tracking.php.

References $ilDB, $in, $res, and $row.

Referenced by ilLPStatusSCORM\_getStatusInfo().

{
global $ilDB;
$in = $ilDB->in('cp_node.cp_node_id', $a_scorm_item_ids, false, 'integer');
$res = $ilDB->queryF(
'SELECT cp_node.cp_node_id id,
cmi_node.user_id user_id,
cmi_node.completion_status completion,
cmi_node.success_status success
FROM cp_node, cmi_node
WHERE '.$in.'
AND cp_node.cp_node_id = cmi_node.cp_node_id
AND cp_node.slm_id = %s',
array('integer'),
array($a_obj_id)
);
$info['completed'] = array();
$info['failed'] = array();
$info['in_progress'] = array();
while($row = $ilDB->fetchAssoc($res))
{
// if any data available, set in progress.
$info['in_progress'][$row["id"]][] = $row["user_id"];
if ($row["completion"] == "completed" || $row["success"] == "passed")
{
$info['completed'][$row["id"]][] = $row["user_id"];
}
if ($row["success"] == "failed")
{
$info['failed'][$row["id"]][] = $row["user_id"];
}
}
return $info;
}

+ Here is the caller graph for this function:

ilSCORM2004Tracking::_getProgressInfo (   $a_obj_id)

Get overall scorm status.

Parameters
object$a_obj_id
Returns

Definition at line 172 of file class.ilSCORM2004Tracking.php.

References $ilDB, $res, and $row.

Referenced by ilLPStatusSCORMPackage\_getStatusInfo().

{
global $ilDB;
$res = $ilDB->queryF('
SELECT * FROM cmi_gobjective
WHERE objective_id = %s
AND scope_id = %s',
array('text', 'integer'),
array('-course_overall_status-', $a_obj_id)
);
$info['completed'] = array();
$info['failed'] = array();
$info['in_progress'] = array();
while($row = $ilDB->fetchAssoc($res))
{
if (self::_isCompleted($row["status"], $row["status"]))
{
$info['completed'][] = $row["user_id"];
}
if (self::_isInProgress($row["status"], $row["status"]))
{
$info['in_progress'][] = $row["user_id"];
}
if (self::_isFailed($row["status"], $row["status"]))
{
$info['failed'][] = $row["user_id"];
}
}
return $info;
}

+ Here is the caller graph for this function:

static ilSCORM2004Tracking::_isCompleted (   $a_status,
  $a_satisfied 
)
static

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

{
if ($a_status == "completed")
{
return true;
}
return false;
}
static ilSCORM2004Tracking::_isFailed (   $a_status,
  $a_satisfied 
)
static

Definition at line 275 of file class.ilSCORM2004Tracking.php.

{
if ($a_status == "completed" && $a_satisfied == "notSatisfied")
{
return true;
}
return false;
}
static ilSCORM2004Tracking::_isInProgress (   $a_status,
  $a_satisfied 
)
static

Definition at line 262 of file class.ilSCORM2004Tracking.php.

{
if ($a_status != "completed")
{
return true;
}
return false;
}
ilSCORM2004Tracking::ilObjSCORM2004Tracking ( )

Constructor public.

Definition at line 37 of file class.ilSCORM2004Tracking.php.

{
}

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