19 declare(strict_types=1);
61 if (
null === $language) {
63 $language = $DIC->language();
64 $language->loadLanguageModule(
'certificate');
66 $language->loadLanguageModule(
'exercise');
67 $language->loadLanguageModule(
'exc');
71 if (
null === $defaultPlaceholderValues) {
74 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
76 if (
null === $objectHelper) {
81 if (
null === $lpMarksHelper) {
86 if (
null === $exerciseMembersHelper) {
91 if (
null === $lpStatusHelper) {
96 if (
null === $utilHelper) {
101 if (
null === $dateHelper) {
120 $exerciseObject = $this->objectHelper->getInstanceByObjId($objId);
122 $mark = $this->lpMarksHelper->lookUpMark($userId, $objId);
123 $status = $this->exerciseMembersHelper->lookUpStatus($objId, $userId);
125 $completionDate = $this->lpStatusHelper->lookupStatusChanged($objId, $userId);
127 $placeHolders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
129 if ($status !==
null) {
130 $placeHolders[
'RESULT_PASSED'] = $this->utilHelper->prepareFormOutput(
131 $this->
language->txt(
'exc_' . $status)
135 $placeHolders[
'RESULT_MARK'] = $this->utilHelper->prepareFormOutput($mark);
136 $placeHolders[
'EXERCISE_TITLE'] = $this->utilHelper->prepareFormOutput($exerciseObject->getTitle());
137 $placeHolders[
'DATE_COMPLETED'] =
'';
138 $placeHolders[
'DATETIME_COMPLETED'] =
'';
140 if ($completionDate !==
'') {
142 $user = $this->objectHelper->getInstanceByObjId($userId);
143 $placeHolders[
'DATE_COMPLETED'] = $this->dateHelper->formatDate($completionDate, $user);
144 $placeHolders[
'DATETIME_COMPLETED'] = $this->dateHelper->formatDateTime($completionDate, $user);
147 return $placeHolders;
157 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
159 $object = $this->objectHelper->getInstanceByObjId($objId);
161 $placeholders[
'RESULT_PASSED'] = $this->utilHelper->prepareFormOutput(
162 $this->
language->txt(
'certificate_var_result_passed')
164 $placeholders[
'RESULT_MARK'] = $this->utilHelper->prepareFormOutput(
165 $this->
language->txt(
'certificate_var_result_mark_short')
167 $placeholders[
'EXERCISE_TITLE'] = $this->utilHelper->prepareFormOutput($object->getTitle());
169 return $placeholders;
getPlaceholderValuesForPreview(int $userId, int $objId)
This method is different then the 'getPlaceholderValues' method, this method is used to create a plac...
readonly ilCertificateDateHelper $dateHelper
readonly ilDefaultPlaceholderValues $defaultPlaceholderValuesObject
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly ilCertificateUtilHelper $utilHelper
readonly ilCertificateLPMarksHelper $lpMarksHelper
__construct(?ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ?ilLanguage $language=null, ?ilCertificateObjectHelper $objectHelper=null, ?ilCertificateLPMarksHelper $lpMarksHelper=null, ?CertificateExerciseMembersHelper $exerciseMembersHelper=null, ?ilCertificateLPStatusHelper $lpStatusHelper=null, ?ilCertificateUtilHelper $utilHelper=null, ?ilCertificateDateHelper $dateHelper=null)
readonly ilLanguage $language
readonly ilCertificateObjectHelper $objectHelper
readonly CertificateExerciseMembersHelper $exerciseMembersHelper
readonly ilCertificateLPStatusHelper $lpStatusHelper
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
language()
description: > Example for rendring a language glyph.