ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestPlaceholderDescription Class Reference
+ Inheritance diagram for ilTestPlaceholderDescription:
+ Collaboration diagram for ilTestPlaceholderDescription:

Public Member Functions

 __construct (?ilDefaultPlaceholderDescription $defaultPlaceholderDescriptionObject=null, ?ilLanguage $language=null, ?ilUserDefinedFieldsPlaceholderDescription $userDefinedFieldPlaceHolderDescriptionObject=null)
 
 createPlaceholderHtmlDescription (?ilTemplate $template=null)
 This methods MUST return an array containing an array with the the description as array value. More...
 
 getPlaceholderDescriptions ()
 This method MUST return an array containing an array with the the description as array value. More...
 
- Public Member Functions inherited from ilCertificatePlaceholderDescription
 createPlaceholderHtmlDescription ()
 

Private Attributes

readonly ilDefaultPlaceholderDescription $defaultPlaceHolderDescriptionObject
 
readonly ilLanguage $language
 
array $placeholder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestPlaceholderDescription::__construct ( ?ilDefaultPlaceholderDescription  $defaultPlaceholderDescriptionObject = null,
?ilLanguage  $language = null,
?ilUserDefinedFieldsPlaceholderDescription  $userDefinedFieldPlaceHolderDescriptionObject = null 
)

Definition at line 30 of file class.ilTestPlaceholderDescription.php.

References $DIC, $language, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ilLegacyFormElementsUtil\prepareFormOutput().

34  {
35  global $DIC;
36 
37  if (null === $language) {
38  $language = $DIC->language();
39  $language->loadLanguageModule('certificate');
40  }
41  $this->language = $language;
42 
43  if (null === $defaultPlaceholderDescriptionObject) {
44  $defaultPlaceholderDescriptionObject = new ilDefaultPlaceholderDescription(
45  $language,
46  $userDefinedFieldPlaceHolderDescriptionObject
47  );
48  }
49  $this->defaultPlaceHolderDescriptionObject = $defaultPlaceholderDescriptionObject;
50 
51  $this->placeholder = $this->defaultPlaceHolderDescriptionObject->getPlaceholderDescriptions();
52 
53  $this->placeholder['RESULT_PASSED'] = ilLegacyFormElementsUtil::prepareFormOutput(
54  $this->language->txt('certificate_var_result_passed')
55  );
56  $this->placeholder['RESULT_POINTS'] = ilLegacyFormElementsUtil::prepareFormOutput(
57  $this->language->txt('certificate_var_result_points')
58  );
59  $this->placeholder['RESULT_PERCENT'] = ilLegacyFormElementsUtil::prepareFormOutput(
60  $this->language->txt('certificate_var_result_percent')
61  );
62  $this->placeholder['MAX_POINTS'] = ilLegacyFormElementsUtil::prepareFormOutput(
63  $this->language->txt('certificate_var_max_points')
64  );
65  $this->placeholder['RESULT_MARK_SHORT'] = ilLegacyFormElementsUtil::prepareFormOutput(
66  $this->language->txt('certificate_var_result_mark_short')
67  );
68  $this->placeholder['RESULT_MARK_LONG'] = ilLegacyFormElementsUtil::prepareFormOutput(
69  $this->language->txt('certificate_var_result_mark_long')
70  );
71  $this->placeholder['TEST_TITLE'] = ilLegacyFormElementsUtil::prepareFormOutput(
72  $this->language->txt('certificate_ph_testtitle')
73  );
74  $this->placeholder['DATE_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
75  $language->txt('certificate_ph_date_completed')
76  );
77  $this->placeholder['DATETIME_COMPLETED'] = ilLegacyFormElementsUtil::prepareFormOutput(
78  $language->txt('certificate_ph_datetime_completed')
79  );
80  }
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.
static prepareFormOutput($a_str, bool $a_strip=false)
global $DIC
Definition: feed.php:28
Collection of basic placeholder values that can be used.
+ Here is the call graph for this function:

Member Function Documentation

◆ createPlaceholderHtmlDescription()

ilTestPlaceholderDescription::createPlaceholderHtmlDescription ( ?ilTemplate  $template = null)

This methods MUST return an array containing an array with the the description as array value.

Definition at line 86 of file class.ilTestPlaceholderDescription.php.

References $id, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

86  : string
87  {
88  if (null === $template) {
89  $template = new ilTemplate('tpl.default_description.html', true, true, 'Services/Certificate');
90  }
91 
92  $template->setVariable('PLACEHOLDER_INTRODUCTION', $this->language->txt('certificate_ph_introduction'));
93 
94  $template->setCurrentBlock('items');
95  foreach ($this->placeholder as $id => $caption) {
96  $template->setVariable('ID', $id);
97  $template->setVariable('TXT', $caption);
98  $template->parseCurrentBlock();
99  }
100 
101  return $template->get();
102  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getPlaceholderDescriptions()

ilTestPlaceholderDescription::getPlaceholderDescriptions ( )

This method MUST return an array containing an array with the the description as array value.

Returns
array - [PLACEHOLDER] => 'description'

Implements ilCertificatePlaceholderDescription.

Definition at line 109 of file class.ilTestPlaceholderDescription.php.

References $placeholder.

109  : array
110  {
111  return $this->placeholder;
112  }

Field Documentation

◆ $defaultPlaceHolderDescriptionObject

readonly ilDefaultPlaceholderDescription ilTestPlaceholderDescription::$defaultPlaceHolderDescriptionObject
private

Definition at line 26 of file class.ilTestPlaceholderDescription.php.

◆ $language

readonly ilLanguage ilTestPlaceholderDescription::$language
private

Definition at line 27 of file class.ilTestPlaceholderDescription.php.

Referenced by __construct().

◆ $placeholder

array ilTestPlaceholderDescription::$placeholder
private

Definition at line 28 of file class.ilTestPlaceholderDescription.php.

Referenced by getPlaceholderDescriptions().


The documentation for this class was generated from the following file: