19 declare(strict_types=1);
40 if (null === $language) {
41 $language = $DIC->language();
46 if (null === $defaultPlaceholderDescriptionObject) {
49 $userDefinedFieldPlaceHolderDescriptionObject
52 $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
54 if (null === $learningProgressObject) {
59 $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
61 $this->placeholder[
'SCORM_TITLE'] = $language->
txt(
'certificate_ph_scormtitle');
62 $this->placeholder[
'SCORM_POINTS'] = $language->
txt(
'certificate_ph_scormpoints');
63 $this->placeholder[
'SCORM_POINTS_MAX'] = $language->
txt(
'certificate_ph_scormmaxpoints');
65 $language->
txt(
'certificate_ph_date_completed')
68 $language->
txt(
'certificate_ph_datetime_completed')
80 if (null === $template) {
81 $template =
new ilTemplate(
'tpl.scorm_description.html',
true,
true,
'Services/Certificate');
84 $template->setCurrentBlock(
'items');
86 foreach ($this->placeholder as
$id => $caption) {
87 $template->setVariable(
'ID',
$id);
88 $template->setVariable(
'TXT', $caption);
89 $template->parseCurrentBlock();
92 $template->setVariable(
'PH_INTRODUCTION', $this->
language->txt(
'certificate_ph_introduction'));
94 $collection = $this->learningProgressObject->getCollectionInstance();
97 $items = $collection->getPossibleItems();
101 $template->setCurrentBlock(
'SCOS');
102 $template->setVariable(
'PH_SCOS', $this->
language->txt(
'certificate_ph_scos'));
103 $template->parseCurrentBlock();
104 $template->setCurrentBlock(
'SCO_HEADER');
105 $template->setVariable(
'PH_TITLE_SCO', $this->
language->txt(
'certificate_ph_title_sco'));
106 $template->setVariable(
'PH_SCO_TITLE', $this->
language->txt(
'certificate_ph_sco_title'));
107 $template->setVariable(
'PH_SCO_POINTS_RAW', $this->
language->txt(
'certificate_ph_sco_points_raw'));
108 $template->setVariable(
'PH_SCO_POINTS_MAX', $this->
language->txt(
'certificate_ph_sco_points_max'));
109 $template->setVariable(
'PH_SCO_POINTS_SCALED', $this->
language->txt(
'certificate_ph_sco_points_scaled'));
111 $template->setCurrentBlock(
'NO_SCO');
112 $template->setVariable(
'PH_NO_SCO', $this->
language->txt(
'certificate_ph_no_sco'));
114 $template->parseCurrentBlock();
118 foreach ($items as $item_id => $sahs_item) {
119 if ($collection->isAssignedEntry($item_id)) {
120 $template->setCurrentBlock(
'SCO');
121 $template->setVariable(
'SCO_TITLE', $sahs_item[
'title']);
122 $template->setVariable(
'PH_SCO_TITLE',
'[SCO_T_' . $counter .
']');
123 $template->setVariable(
'PH_SCO_POINTS_RAW',
'[SCO_P_' . $counter .
']');
124 $template->setVariable(
'PH_SCO_POINTS_MAX',
'[SCO_PM_' . $counter .
']');
125 $template->setVariable(
'PH_SCO_POINTS_SCALED',
'[SCO_PP_' . $counter .
']');
126 $template->parseCurrentBlock();
132 return $template->get();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule(string $a_module)
Load language module.
__construct(ilObject $object, ?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilObjectLP $learningProgressObject=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null)
ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
getPlaceholderDescriptions()
This method MUST return an array containing an array with the the description as array value...
createPlaceholderHtmlDescription(ilTemplate $template=null)
This methods MUST return an array containing an array with the the description as array value...
ilObjectLP $learningProgressObject
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Collection of basic placeholder values that can be used.
static getInstance(int $obj_id)