76 if (null === $defaultPlaceholderValues) {
79 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
109 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
111 $placeholders[
'OBJECT_TITLE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_object_title'));
112 $placeholders[
'OBJECT_DESCRIPTION'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_object_description'));
114 $placeholders[
'MASTERY_SCORE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_mastery_score'));
115 $placeholders[
'REACHED_SCORE'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'lti_cert_ph_reached_score'));
117 return $placeholders;
122 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
125 $object = $this->objectHelper->getInstanceByObjId($objId);
127 $placeholders[
'OBJECT_TITLE'] = $this->utilHelper->prepareFormOutput($object->getTitle());
128 $placeholders[
'OBJECT_DESCRIPTION'] = $this->utilHelper->prepareFormOutput($object->getDescription());
130 $placeholders[
'REACHED_SCORE'] = $this->utilHelper->prepareFormOutput($this->
getReachedScore((
int) $objId, (
int) $userId));
132 return $placeholders;
146 $reachedScore = sprintf(
'%0.2f %%', $cmixResult->getScore() * 100);
148 return $reachedScore;
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
Collection of basic placeholder values that can be used.
getReachedScore(int $objectId, int $userId)
__construct(ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateUserObjectHelper $userObjectHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateDateHelper $dateHelper=null)
static getEmptyInstance()
static getInstanceByObjIdAndUsrId($objId, $usrId)
Just a wrapper class to create Unit Test for other classes.
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
$defaultPlaceholderValuesObject