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);
33 return (
array) $plugin->getLPNotAttempted();
36 return self::getLPStatusData($a_obj_id, self::LP_STATUS_NOT_ATTEMPTED_NUM);
44 $plugin = self::initPluginObj($a_obj_id);
47 return (
array) $plugin->getLPInProgress();
50 return self::getLPStatusData($a_obj_id, self::LP_STATUS_IN_PROGRESS_NUM);
58 $plugin = self::initPluginObj($a_obj_id);
61 return (
array) $plugin->getLPCompleted();
64 return self::getLPStatusData($a_obj_id, self::LP_STATUS_COMPLETED_NUM);
72 $plugin = self::initPluginObj($a_obj_id);
75 return (
array) $plugin->getLPFailed();
78 return self::getLPStatusData($a_obj_id, self::LP_STATUS_FAILED_NUM);
86 $plugin = self::initPluginObj($a_obj_id);
90 return $plugin->getLPStatusForUser($a_user_id);
93 return self::getLPDataForUser($a_obj_id, $a_user_id);
97 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
102 $plugin = self::initPluginObj($a_obj_id);
105 if (method_exists($plugin,
"getPercentageForUser")) {
106 return $plugin->getPercentageForUser($a_user_id);
110 return self::getPercentageForUser($a_obj_id, $a_user_id);
129 $set = $ilDB->query(
"SELECT usr_id" .
130 " FROM ut_lp_marks" .
131 " WHERE obj_id = " . $ilDB->quote($a_obj_id,
"integer") .
132 " AND status = " . $ilDB->quote($a_status,
"integer"));
133 while (
$row = $ilDB->fetchAssoc($set)) {
134 $all[] =
$row[
"usr_id"];
150 $set = $ilDB->query(
"SELECT status" .
151 " FROM ut_lp_marks" .
152 " WHERE obj_id = " . $ilDB->quote($a_obj_id,
"integer") .
153 " AND usr_id = " . $ilDB->quote($a_user_id,
"integer"));
154 $row = $ilDB->fetchAssoc($set);
155 $status =
$row[
"status"];
157 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
166 $set = $ilDB->query(
"SELECT percentage" .
167 " FROM ut_lp_marks" .
168 " WHERE obj_id = " . $ilDB->quote($a_obj_id,
"integer") .
169 " AND usr_id = " . $ilDB->quote($a_user_id,
"integer"));
170 $row = $ilDB->fetchAssoc($set);
171 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)