19declare(strict_types=0);
36 self::$userResultCache[
$objId] = array();
39 if (!isset(self::$userResultCache[
$objId][$usrId])) {
41 self::$userResultCache[
$objId][$usrId] = $ltiUserResult;
43 return self::$userResultCache[
$objId][$usrId];
59 $ltiResult = $this->getLtiUserResult($a_obj_id, $a_usr_id);
62 $object = $this->ensureObject($a_obj_id, $a_obj);
63 $ltiMasteryScore = $object->getMasteryScore();
65 if ($ltiResult->getResult() >= $ltiMasteryScore) {
66 return self::LP_STATUS_COMPLETED_NUM;
69 return self::LP_STATUS_IN_PROGRESS_NUM;
72 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
80 $ltiResult = $this->getLtiUserResult($a_obj_id, $a_usr_id);
83 return (
int) $ltiResult->getResult() * 100;
Class ilLPStatusLtiOutcome.
determinePercentage(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
ensureObject(int $objId, $object)
static array $userResultCache
getLtiUserResult(int $objId, int $usrId)
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
static getByKeys(int $a_obj_id, int $a_usr_id, ?bool $a_create=false)
Get a result by object and user key.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
if(!file_exists('../ilias.ini.php'))