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);
127 $ilDB = $DIC[
'ilDB'];
131 $set =
$ilDB->query(
"SELECT usr_id" .
132 " FROM ut_lp_marks" .
133 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
134 " AND status = " .
$ilDB->quote($a_status,
"integer"));
136 $all[] =
$row[
"usr_id"];
152 $ilDB = $DIC[
'ilDB'];
154 $set =
$ilDB->query(
"SELECT status" .
155 " FROM ut_lp_marks" .
156 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
157 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer"));
159 $status =
$row[
"status"];
161 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
170 $ilDB = $DIC[
'ilDB'];
172 $set =
$ilDB->query(
"SELECT percentage" .
173 " FROM ut_lp_marks" .
174 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
175 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer"));
177 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)
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)