ILIAS  Release_3_10_x_branch Revision 61812
 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)
 _getProgressInfo ($a_obj_id)
 _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.

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

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

References $res, DB_FETCHMODE_OBJECT, and ilUtil\quoteArray().

Referenced by ilLPStatusSCORM\_getStatusInfo().

{
global $ilDB;
$query = "SELECT cmi_node.user_id as user_id, COUNT(user_id) as completed FROM cp_node, cmi_node ".
"WHERE cp_node.cp_node_id IN(".implode(",",ilUtil::quoteArray($a_scorm_item_ids)).
") AND cp_node.cp_node_id = cmi_node.cp_node_id".
" AND cp_node.slm_id = ".$ilDB->quote($a_obj_id).
" AND completion_status = 'completed' ".
" GROUP BY cmi_node.user_id";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$users[$row->user_id] = $row->completed;
}
return $users ? $users : array();
}

+ Here is the call graph for this function:

+ 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.

{
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 190 of file class.ilSCORM2004Tracking.php.

References $res, DB_FETCHMODE_ASSOC, and ilUtil\quoteArray().

Referenced by ilLPStatusSCORM\_getStatusInfo().

{
global $ilDB;
$query = "SELECT cp_node.cp_node_id as id, cmi_node.user_id as user_id, ".
" cmi_node.completion_status as completion, cmi_node.success_status as success ".
" FROM cp_node, cmi_node ".
"WHERE cp_node.cp_node_id IN(".implode(",",ilUtil::quoteArray($a_scorm_item_ids)).
") AND cp_node.cp_node_id = cmi_node.cp_node_id".
" AND cp_node.slm_id = ".$ilDB->quote($a_obj_id);
$res = $ilDB->query($query);
$info['completed'] = array();
$info['failed'] = array();
$info['in_progress'] = array();
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
// 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 call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004Tracking::_getProgressInfo (   $a_obj_id)

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

References $res, and DB_FETCHMODE_ASSOC.

Referenced by ilLPStatusSCORMPackage\_getStatusInfo().

{
global $ilDB;
$query = "SELECT * FROM cmi_gobjective ".
" WHERE objective_id = ".$ilDB->quote("-course_overall_status-").
" AND scope_id = ".$ilDB->quote($a_obj_id);
$res = $ilDB->query($query);
$info['completed'] = array();
$info['failed'] = array();
$info['in_progress'] = array();
while($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
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 227 of file class.ilSCORM2004Tracking.php.

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

Definition at line 253 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 240 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: