3declare(strict_types=0);
22 return $olp->getPluginInstance();
30 return (array)
$plugin->getLPNotAttempted();
35 self::LP_STATUS_NOT_ATTEMPTED_NUM
47 return (array)
$plugin->getLPInProgress();
52 self::LP_STATUS_IN_PROGRESS_NUM
64 return (array)
$plugin->getLPCompleted();
69 self::LP_STATUS_COMPLETED_NUM
81 return (array)
$plugin->getLPFailed();
86 self::LP_STATUS_FAILED_NUM
102 return $plugin->getLPStatusForUser($a_usr_id);
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);
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"];
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;
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 _getInProgress(int $a_obj_id)
static initPluginObj(int $a_obj_id)
Get ilObjectPlugin for object id.
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static getLPStatusData(int $a_obj_id, int $a_status)
Read existing LP status data.
static _getCompleted(int $a_obj_id)
static _getFailed(int $a_obj_id)
static getLPDataForUser(int $a_obj_id, int $a_user_id)
Read existing LP status data for user.
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
static _getNotAttempted(int $a_obj_id)
static getPercentageForUser(int $a_obj_id, int $a_user_id)
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_NOT_ATTEMPTED_NUM
static getInstance(int $obj_id)