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;
An exception for terminatinating execution or to throw for unit testing.
Just a wrapper class to create Unit Test for other classes.
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
__construct(ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateUserObjectHelper $userObjectHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateDateHelper $dateHelper=null)
getReachedScore(int $objectId, int $userId)
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
static getInstanceByObjIdAndUsrId($objId, $usrId)
static getEmptyInstance()
Collection of basic placeholder values that can be used.