19 declare(strict_types=0);
36 return $olp->getPluginInstance();
41 $plugin = self::initPluginObj($a_obj_id);
44 return (array)
$plugin->getLPNotAttempted();
47 return self::getLPStatusData(
49 self::LP_STATUS_NOT_ATTEMPTED_NUM
58 $plugin = self::initPluginObj($a_obj_id);
61 return (array)
$plugin->getLPInProgress();
64 return self::getLPStatusData(
66 self::LP_STATUS_IN_PROGRESS_NUM
75 $plugin = self::initPluginObj($a_obj_id);
78 return (array)
$plugin->getLPCompleted();
81 return self::getLPStatusData(
83 self::LP_STATUS_COMPLETED_NUM
92 $plugin = self::initPluginObj($a_obj_id);
95 return (array)
$plugin->getLPFailed();
98 return self::getLPStatusData(
100 self::LP_STATUS_FAILED_NUM
110 ?
object $a_obj =
null 112 $plugin = self::initPluginObj($a_obj_id);
116 return $plugin->getLPStatusForUser($a_usr_id);
119 return self::getLPDataForUser($a_obj_id, $a_usr_id);
123 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
129 ?
object $a_obj =
null 131 $plugin = self::initPluginObj($a_obj_id);
134 if (method_exists(
$plugin,
"getPercentageForUser")) {
135 return $plugin->getPercentageForUser($a_usr_id);
139 return self::getPercentageForUser($a_obj_id, $a_usr_id);
154 $ilDB = $DIC[
'ilDB'];
159 " FROM ut_lp_marks" .
160 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
161 " AND status = " .
$ilDB->quote($a_status,
"integer")
163 while ($row =
$ilDB->fetchAssoc($set)) {
164 $all[] = (
int) $row[
"usr_id"];
178 $ilDB = $DIC[
'ilDB'];
182 " FROM ut_lp_marks" .
183 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
184 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer")
186 $row =
$ilDB->fetchAssoc($set);
187 $status = $row[
"status"];
189 $status = self::LP_STATUS_NOT_ATTEMPTED_NUM;
200 $ilDB = $DIC[
'ilDB'];
203 "SELECT percentage" .
204 " FROM ut_lp_marks" .
205 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
206 " AND usr_id = " .
$ilDB->quote($a_user_id,
"integer")
208 $row =
$ilDB->fetchAssoc($set);
209 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)
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)
static _getFailed(int $a_obj_id)