75 if (null === $defaultPlaceholderValues) {
78 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
108 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
110 $placeholders[
'OBJECT_TITLE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_object_title'));
111 $placeholders[
'OBJECT_DESCRIPTION'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_object_description'));
113 $placeholders[
'MASTERY_SCORE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_mastery_score'));
114 $placeholders[
'REACHED_SCORE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_reached_score'));
116 return $placeholders;
121 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
124 $object = $this->objectHelper->getInstanceByObjId($objId);
126 $placeholders[
'OBJECT_TITLE'] = $this->utilHelper->prepareFormOutput($object->getTitle());
127 $placeholders[
'OBJECT_DESCRIPTION'] = $this->utilHelper->prepareFormOutput($object->getDescription());
129 $placeholders[
'MASTERY_SCORE'] = $this->utilHelper->prepareFormOutput($this->
getMasteryScore($object));
130 $placeholders[
'REACHED_SCORE'] = $this->utilHelper->prepareFormOutput($this->
getReachedScore($object, $userId));
132 return $placeholders;
138 return $masteryScore;
145 $reachedScore = sprintf(
'%0.2f %%', 0);
147 $reachedScore = sprintf(
'%0.2f %%', $userResult->getResult() * 100);
150 return $reachedScore;
Collection of basic placeholder values that can be used.
static getByKeys($a_obj_id, $a_usr_id, $a_create=false)
Get a result by object and user key.
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
getReachedScore(ilObjLTIConsumer $object, int $userId)
getMasteryScore(ilObjLTIConsumer $object)
__construct(ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateUserObjectHelper $userObjectHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateDateHelper $dateHelper=null)
getId()
get object id public
$defaultPlaceholderValuesObject
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
Just a wrapper class to create Unit Test for other classes.