4 include_once
'./Services/Tracking/classes/class.ilLPStatus.php';
23 include_once
"Services/Object/classes/class.ilObjectLP.php";
25 return $olp->getPluginInstance();
30 $plugin = self::initPluginObj($a_obj_id);
35 return (
array)$plugin->getLPNotAttempted();
40 return self::getLPStatusData($a_obj_id, self::LP_STATUS_NOT_ATTEMPTED_NUM);
48 $plugin = self::initPluginObj($a_obj_id);
53 return (
array)$plugin->getLPInProgress();
58 return self::getLPStatusData($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM);
66 $plugin = self::initPluginObj($a_obj_id);
71 return (
array)$plugin->getLPCompleted();
76 return self::getLPStatusData($a_obj_id, self::LP_STATUS_COMPLETED_NUM);
84 $plugin = self::initPluginObj($a_obj_id);
89 return (
array)$plugin->getLPFailed();
94 return self::getLPStatusData($a_obj_id, self::LP_STATUS_FAILED_NUM);
102 $plugin = self::initPluginObj($a_obj_id);
108 return $plugin->getLPStatusForUser($a_user_id);
113 return self::getLPDataForUser($a_obj_id, $a_user_id);
117 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
122 $plugin = self::initPluginObj($a_obj_id);
127 if (method_exists($plugin,
"getPercentageForUser"))
129 return $plugin->getPercentageForUser($a_user_id);
133 return self::getPercentageForUser($a_obj_id, $a_user_id);
152 $set = $ilDB->query(
"SELECT usr_id".
154 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
155 " AND status = ".$ilDB->quote($a_status,
"integer"));
156 while(
$row = $ilDB->fetchAssoc($set))
158 $all[] =
$row[
"usr_id"];
174 $set = $ilDB->query(
"SELECT status".
176 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
177 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer"));
178 $row = $ilDB->fetchAssoc($set);
179 $status =
$row[
"status"];
182 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
191 $set = $ilDB->query(
"SELECT percentage".
193 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
194 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer"));
195 $row = $ilDB->fetchAssoc($set);
196 return (
int)
$row[
"percentage"];
static getLPDataForUser($a_obj_id, $a_user_id)
Read existing LP status data for user.
static initPluginObj($a_obj_id)
Get ilObjectPlugin for object id.
static _getInProgress($a_obj_id)
determinePercentage($a_obj_id, $a_user_id, $a_obj=null)
static getLPStatusData($a_obj_id, $a_status)
Read existing LP status data.
static _getCompleted($a_obj_id)
static _getNotAttempted($a_obj_id)
Create styles array
The data for the language used.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
static _getFailed($a_obj_id)
static getInstance($a_obj_id)
static getPercentageForUser($a_obj_id, $a_user_id)
determineStatus($a_obj_id, $a_user_id, $a_obj=null)