27 if (!isset($this->cmixUserResult[
$objId])) {
28 $this->cmixUserResult[
$objId] = array();
31 if (!isset($this->cmixUserResult[$objId][$usrId])) {
36 $this->cmixUserResult[
$objId][$usrId] = null;
40 return $this->cmixUserResult[
$objId][$usrId];
59 return self::getUserIdsByLpStatusNum(
67 return self::getUserIdsByLpStatusNum(
75 return self::getUserIdsByLpStatusNum(
83 return self::getUserIdsByLpStatusNum(
91 $statusInfo = self::_getStatusInfo(
$objId);
92 return $statusInfo[$lpStatusNum];
97 if (self::$statusInfoCache[$a_obj_id] === null) {
98 self::$statusInfoCache[$a_obj_id] = self::loadStatusInfo($a_obj_id);
101 return self::$statusInfoCache[$a_obj_id];
116 foreach ($cmixUsers as $cmixUser) {
119 if (isset($userResults[$cmixUser->getUsrId()])) {
120 $userResult = $userResults[$cmixUser->getUsrId()];
122 if (self::_resultSatisfyCompleted($userResult, $a_obj_id)) {
126 if (self::_resultSatisfyFailed($userResult, $a_obj_id)) {
131 $statusInfo[$status][] = $cmixUser->getUsrId();
143 return self::LP_STATUS_COMPLETED_NUM;
147 return self::LP_STATUS_FAILED_NUM;
150 return self::LP_STATUS_IN_PROGRESS_NUM;
154 return self::LP_STATUS_IN_PROGRESS_NUM;
157 return self::LP_STATUS_NOT_ATTEMPTED_NUM;
165 return 100 * (float) $cmixResult->getScore();
184 $lpStatusDetermination =
new static($a_obj_id);
185 return $lpStatusDetermination->resultSatisfyCompleted($result);
201 $lpStatusDetermination =
new static($a_obj_id);
202 return $lpStatusDetermination->resultSatisfyFailed($result);
const LP_STATUS_COMPLETED_NUM
getCmixUserResult($objId, $usrId)
static getResultsForObject($objId)
static _resultSatisfyFailed(ilCmiXapiResult $result, $a_obj_id)
static getUsersForObject($objId, $asUsrId=false)
static _getCompleted($a_obj_id)
const LP_STATUS_IN_PROGRESS_NUM
determinePercentage($a_obj_id, $a_usr_id, $a_obj=null)
static loadStatusInfo($a_obj_id)
static _getNotAttempted($a_obj_id)
determineStatus($a_obj_id, $a_usr_id, $a_obj=null)
static _getStatusInfo($a_obj_id)
resultSatisfyCompleted(ilCmiXapiResult $result)
static _getInProgress($a_obj_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByObjIdAndUsrId($objId, $usrId)
static _resultSatisfyCompleted(ilCmiXapiResult $result, $a_obj_id)
const LP_STATUS_NOT_ATTEMPTED_NUM
static exists($objId, $usrId, $privacyIdent=999)
ensureObject($objId, $object=null)
static getUserIdsByLpStatusNum($objId, $lpStatusNum)
static _getFailed($a_obj_id)
resultSatisfyFailed(ilCmiXapiResult $result)
const LP_STATUS_FAILED_NUM