73 $language->loadLanguageModule(
'exercise');
78 if (null === $defaultPlaceholderValues) {
81 $this->defaultPlaceholderValuesObject = $defaultPlaceholderValues;
130 $exerciseObject = $this->objectHelper->getInstanceByObjId($objId);
132 $mark = (string) $this->lpMarksHelper->lookUpMark($userId, $objId);
133 $status = $this->exerciseMembersHelper->lookUpStatus($objId, $userId);
135 $completionDate = $this->lpStatusHelper->lookupStatusChanged($objId, $userId);
137 $placeHolders = $this->defaultPlaceholderValuesObject->getPlaceholderValues($userId, $objId);
139 $placeHolders[
'RESULT_PASSED'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'exc_' . $status));
140 $placeHolders[
'RESULT_MARK'] = $this->utilHelper->prepareFormOutput($mark);
141 $placeHolders[
'EXERCISE_TITLE'] = $this->utilHelper->prepareFormOutput($exerciseObject->getTitle());
142 $placeHolders[
'DATE_COMPLETED'] =
'';
143 $placeHolders[
'DATETIME_COMPLETED'] =
'';
145 if ($completionDate !==
false &&
146 $completionDate !== null &&
147 $completionDate !==
'' 149 $placeHolders[
'DATE_COMPLETED'] = $this->dateHelper->formatDate($completionDate);
150 $placeHolders[
'DATETIME_COMPLETED'] = $this->dateHelper->formatDateTime($completionDate);
153 return $placeHolders;
167 $placeholders = $this->defaultPlaceholderValuesObject->getPlaceholderValuesForPreview($userId, $objId);
169 $object = $this->objectHelper->getInstanceByObjId($objId);
171 $placeholders[
'RESULT_PASSED'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'certificate_var_result_passed'));
172 $placeholders[
'RESULT_MARK'] = $this->utilHelper->prepareFormOutput($this->
language->txt(
'certificate_var_result_mark_short'));
173 $placeholders[
'EXERCISE_TITLE'] = $this->utilHelper->prepareFormOutput($object->getTitle());
175 return $placeholders;
Collection of basic placeholder values that can be used.
getPlaceholderValues(int $userId, int $objId)
This method MUST return an array that contains the actual data for the given user of the given object...
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.
$defaultPlaceholderValuesObject
__construct(ilDefaultPlaceholderValues $defaultPlaceholderValues=null, ilLanguage $language=null, ilCertificateObjectHelper $objectHelper=null, ilCertificateLPMarksHelper $lpMarksHelper=null, ilCertificateExerciseMembersHelper $exerciseMembersHelper=null, ilCertificateLPStatusHelper $lpStatusHelper=null, ilCertificateUtilHelper $utilHelper=null, ilCertificateDateHelper $dateHelper=null)