3 declare(strict_types=0);
22 return $olp->getPluginInstance();
27 $plugin = self::initPluginObj($a_obj_id);
30 return (array)
$plugin->getLPNotAttempted();
33 return self::getLPStatusData(
35 self::LP_STATUS_NOT_ATTEMPTED_NUM
44 $plugin = self::initPluginObj($a_obj_id);
47 return (array)
$plugin->getLPInProgress();
50 return self::getLPStatusData(
52 self::LP_STATUS_IN_PROGRESS_NUM
61 $plugin = self::initPluginObj($a_obj_id);
64 return (array)
$plugin->getLPCompleted();
67 return self::getLPStatusData(
69 self::LP_STATUS_COMPLETED_NUM
78 $plugin = self::initPluginObj($a_obj_id);
81 return (array)
$plugin->getLPFailed();
84 return self::getLPStatusData(
86 self::LP_STATUS_FAILED_NUM
98 $plugin = self::initPluginObj($a_obj_id);
102 return $plugin->getLPStatusForUser($a_usr_id);
105 return self::getLPDataForUser($a_obj_id, $a_usr_id);
109 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
115 ?
object $a_obj = null
117 $plugin = self::initPluginObj($a_obj_id);
120 if (method_exists(
$plugin,
"getPercentageForUser")) {
121 return $plugin->getPercentageForUser($a_usr_id);
125 return self::getPercentageForUser($a_obj_id, $a_usr_id);
140 $ilDB = $DIC[
'ilDB'];
145 " FROM ut_lp_marks" .
146 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
147 " AND status = " .
$ilDB->quote($a_status,
"integer")
149 while ($row =
$ilDB->fetchAssoc($set)) {
150 $all[] = (
int) $row[
"usr_id"];
164 $ilDB = $DIC[
'ilDB'];
168 " FROM ut_lp_marks" .
169 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
170 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer")
172 $row =
$ilDB->fetchAssoc($set);
173 $status = $row[
"status"];
175 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
186 $ilDB = $DIC[
'ilDB'];
189 "SELECT percentage" .
190 " FROM ut_lp_marks" .
191 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
192 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer")
194 $row =
$ilDB->fetchAssoc($set);
195 return (
int) ($row[
"percentage"] ?? 0);
static getLPDataForUser(int $a_obj_id, int $a_user_id)
Read existing LP status data for user.
static getPercentageForUser(int $a_obj_id, int $a_user_id)
static _getCompleted(int $a_obj_id)
static initPluginObj(int $a_obj_id)
Get ilObjectPlugin for object id.
static _getInProgress(int $a_obj_id)
static getLPStatusData(int $a_obj_id, int $a_status)
Read existing LP status data.
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static _getNotAttempted(int $a_obj_id)
static getInstance(int $obj_id)
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
static _getFailed(int $a_obj_id)