ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssLacLegendGUI Class Reference
+ Collaboration diagram for ilAssLacLegendGUI:

Public Member Functions

 __construct (ilGlobalTemplateInterface $pageTemplate, ilLanguage $lng, \ILIAS\UI\Factory $uiFactory)
 ilAssLacLegendGUI constructor. More...
 
 getQuestionOBJ ()
 
 setQuestionOBJ (assQuestion $questionOBJ)
 
 get ()
 

Protected Member Functions

 getTemplate ()
 

Protected Attributes

 $lng
 
 $pageTemplate
 

Private Member Functions

 renderCommonLegendPart (ilTemplate $tpl)
 
 renderQuestSpecificLegendPart (ilTemplate $tpl)
 
 renderQuestSpecificExamples (ilTemplate $tpl)
 
 buildLangVarsByExampleCode (string $questionType, string $exampleCode)
 
 renderExample (ilTemplate $tpl, string $langVarE, string $langVarD)
 
 getQuestionTypeSpecificExpressions ()
 
 getCommonElements ()
 
 getAvailableExpressionTypes ()
 
 getExpressionTypeExamplesByQuestionType (string $questionType)
 
 renderExamples (ilTemplate $tpl, array $examples, string $questionType)
 

Private Attributes

 $questionOBJ
 
 $examplesByQuestionType
 
 $uiFactory
 

Detailed Description

Definition at line 23 of file class.ilAssLacLegendGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssLacLegendGUI::__construct ( ilGlobalTemplateInterface  $pageTemplate,
ilLanguage  $lng,
\ILIAS\UI\Factory  $uiFactory 
)

ilAssLacLegendGUI constructor.

Parameters
ilGlobalTemplateInterface$pageTemplate
ilLanguage$lng
\ILIAS\UI\Factory$uiFactory

Definition at line 58 of file class.ilAssLacLegendGUI.php.

References $lng, $pageTemplate, $uiFactory, ILIAS\Repository\lng(), and null.

62  {
63  $this->pageTemplate = $pageTemplate;
64  $this->lng = $lng;
65  $this->uiFactory = $uiFactory;
66  $this->questionOBJ = null;
67  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Member Function Documentation

◆ buildLangVarsByExampleCode()

ilAssLacLegendGUI::buildLangVarsByExampleCode ( string  $questionType,
string  $exampleCode 
)
private
Parameters
string$questionType
string$exampleCode
Returns
string[]

Definition at line 180 of file class.ilAssLacLegendGUI.php.

Referenced by renderExamples().

180  : array
181  {
182  $langVar = 'lacex_' . $questionType . '_' . $exampleCode;
183 
184  return [$langVar . '_e', $langVar . '_d'];
185  }
+ Here is the caller graph for this function:

◆ get()

ilAssLacLegendGUI::get ( )
Returns

Definition at line 85 of file class.ilAssLacLegendGUI.php.

References getTemplate(), ILIAS\Repository\lng(), renderCommonLegendPart(), renderQuestSpecificExamples(), and renderQuestSpecificLegendPart().

85  : \ILIAS\UI\Component\Modal\Modal
86  {
87  $this->pageTemplate->addCss('assets/css/lac_legend.css');
88 
89  $tpl = $this->getTemplate();
90 
91  $this->renderCommonLegendPart($tpl);
92  $this->renderQuestSpecificLegendPart($tpl);
93  $this->renderQuestSpecificExamples($tpl);
94 
95  return $this->uiFactory->modal()->lightbox([
96  $this->uiFactory->modal()->lightboxTextPage(
97  $tpl->get(),
98  $this->lng->txt('qpl_skill_point_eval_by_solution_compare')
99  ),
100  ]);
101  }
renderCommonLegendPart(ilTemplate $tpl)
renderQuestSpecificExamples(ilTemplate $tpl)
renderQuestSpecificLegendPart(ilTemplate $tpl)
+ Here is the call graph for this function:

◆ getAvailableExpressionTypes()

ilAssLacLegendGUI::getAvailableExpressionTypes ( )
private
Returns
array<string, string>

Definition at line 236 of file class.ilAssLacLegendGUI.php.

References iQuestionCondition\EmptyAnswerExpression, iQuestionCondition\ExclusiveResultExpression, iQuestionCondition\MatchingResultExpression, iQuestionCondition\NumberOfResultExpression, iQuestionCondition\NumericResultExpression, iQuestionCondition\OrderingResultExpression, iQuestionCondition\PercentageResultExpression, and iQuestionCondition\StringResultExpression.

Referenced by getQuestionTypeSpecificExpressions().

236  : array
237  {
238  return [
239  iQuestionCondition::PercentageResultExpression => 'qpl_lac_desc_compare_with_quest_res',
240  iQuestionCondition::NumericResultExpression => 'qpl_lac_desc_compare_with_number',
241  iQuestionCondition::StringResultExpression => 'qpl_lac_desc_compare_with_text',
242  iQuestionCondition::MatchingResultExpression => 'qpl_lac_desc_compare_with_assignment',
243  iQuestionCondition::OrderingResultExpression => 'qpl_lac_desc_compare_with_sequence',
244  iQuestionCondition::NumberOfResultExpression => 'qpl_lac_desc_compare_with_answer_n',
245  iQuestionCondition::ExclusiveResultExpression => 'qpl_lac_desc_compare_with_exact_sequence',
246  iQuestionCondition::EmptyAnswerExpression => 'qpl_lac_desc_compare_answer_exist'
247  ];
248  }
+ Here is the caller graph for this function:

◆ getCommonElements()

ilAssLacLegendGUI::getCommonElements ( )
private
Returns
array<string, string>

Definition at line 219 of file class.ilAssLacLegendGUI.php.

References ILIAS\Repository\lng().

Referenced by renderCommonLegendPart().

219  : array
220  {
221  return [
222  '&' => $this->lng->txt('qpl_lac_desc_logical_and'),
223  '|' => $this->lng->txt('qpl_lac_desc_logical_or'),
224  '!' => $this->lng->txt('qpl_lac_desc_negation'),
225  '()' => $this->lng->txt('qpl_lac_desc_brackets'),
226  //'Qn' => $this->lng->txt('qpl_lac_desc_res_of_quest_n'),
227  //'Qn[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_quest_n'),
228  'R' => $this->lng->txt('qpl_lac_desc_res_of_cur_quest'),
229  'R[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_cur_quest')
230  ];
231  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExpressionTypeExamplesByQuestionType()

ilAssLacLegendGUI::getExpressionTypeExamplesByQuestionType ( string  $questionType)
private
Parameters
string$questionType
Returns
string[]

Definition at line 254 of file class.ilAssLacLegendGUI.php.

Referenced by renderQuestSpecificExamples().

254  : array
255  {
256  if (!isset($this->examplesByQuestionType[$questionType])) {
257  return [];
258  }
259 
260  return $this->examplesByQuestionType[$questionType];
261  }
+ Here is the caller graph for this function:

◆ getQuestionOBJ()

ilAssLacLegendGUI::getQuestionOBJ ( )
Returns
assQuestion|null

Definition at line 72 of file class.ilAssLacLegendGUI.php.

References $questionOBJ.

Referenced by getQuestionTypeSpecificExpressions(), renderQuestSpecificExamples(), and renderQuestSpecificLegendPart().

73  {
74  return $this->questionOBJ;
75  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getQuestionTypeSpecificExpressions()

ilAssLacLegendGUI::getQuestionTypeSpecificExpressions ( )
private
Returns
array<string, string>

Definition at line 203 of file class.ilAssLacLegendGUI.php.

References getAvailableExpressionTypes(), and getQuestionOBJ().

Referenced by renderQuestSpecificLegendPart().

203  : array
204  {
205  $availableExpressionTypes = $this->getAvailableExpressionTypes();
206 
207  $expressionTypes = [];
208 
209  foreach ($this->getQuestionOBJ()->getExpressionTypes() as $expressionType) {
210  $expressionTypes[$expressionType] = $availableExpressionTypes[$expressionType];
211  }
212 
213  return $expressionTypes;
214  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilAssLacLegendGUI::getTemplate ( )
protected
Returns
ilTemplate
Exceptions
ilTemplateException

Definition at line 107 of file class.ilAssLacLegendGUI.php.

Referenced by get().

107  : ilTemplate
108  {
109  return new ilTemplate(
110  'tpl.qpl_logical_answer_compare_legend.html',
111  true,
112  true,
113  'components/ILIAS/TestQuestionPool'
114  );
115  }
+ Here is the caller graph for this function:

◆ renderCommonLegendPart()

ilAssLacLegendGUI::renderCommonLegendPart ( ilTemplate  $tpl)
private
Parameters
ilTemplate$tpl

Definition at line 120 of file class.ilAssLacLegendGUI.php.

References getCommonElements(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by get().

120  : void
121  {
122  $tpl->setVariable(
123  'COMMON_ELEMENTS_HEADER',
124  $this->lng->txt('qpl_lac_legend_header_common')
125  );
126 
127  foreach ($this->getCommonElements() as $element => $description) {
128  $tpl->setCurrentBlock('common_elements');
129  $tpl->setVariable('CE_ELEMENT', $element);
130  $tpl->setVariable('CE_DESCRIPTION', $description);
131  $tpl->parseCurrentBlock();
132  }
133  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderExample()

ilAssLacLegendGUI::renderExample ( ilTemplate  $tpl,
string  $langVarE,
string  $langVarD 
)
private
Parameters
ilTemplate$tpl
string$langVarE
string$langVarD

Definition at line 192 of file class.ilAssLacLegendGUI.php.

References ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by renderExamples().

192  : void
193  {
194  $tpl->setCurrentBlock('quest_specific_examples');
195  $tpl->setVariable('QSEX_ELEMENT', $this->lng->txt($langVarE));
196  $tpl->setVariable('QSEX_DESCRIPTION', $this->lng->txt($langVarD));
197  $tpl->parseCurrentBlock();
198  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderExamples()

ilAssLacLegendGUI::renderExamples ( ilTemplate  $tpl,
array  $examples,
string  $questionType 
)
private
Parameters
ilTemplate$tpl
string[]$examples
string$questionType

Definition at line 268 of file class.ilAssLacLegendGUI.php.

References buildLangVarsByExampleCode(), and renderExample().

Referenced by renderQuestSpecificExamples().

268  : void
269  {
270  foreach ($examples as $exampleCode) {
271  list($langVarE, $langVarD) = $this->buildLangVarsByExampleCode($questionType, $exampleCode);
272  $this->renderExample($tpl, $langVarE, $langVarD);
273  }
274  }
renderExample(ilTemplate $tpl, string $langVarE, string $langVarD)
buildLangVarsByExampleCode(string $questionType, string $exampleCode)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderQuestSpecificExamples()

ilAssLacLegendGUI::renderQuestSpecificExamples ( ilTemplate  $tpl)
private
Parameters
ilTemplate$tpl

Definition at line 158 of file class.ilAssLacLegendGUI.php.

References getExpressionTypeExamplesByQuestionType(), getQuestionOBJ(), ILIAS\Repository\lng(), renderExamples(), and HTML_Template_IT\setVariable().

Referenced by get().

158  : void
159  {
160  $tpl->setVariable(
161  'QUEST_SPECIFIC_EXAMPLES_HEADER',
162  $this->lng->txt('lacex_example_header')
163  );
164 
165  $questionTypes = [
166  'assQuestion', $this->getQuestionOBJ()->getQuestionType()
167  ];
168 
169  foreach ($questionTypes as $questionType) {
170  $examples = $this->getExpressionTypeExamplesByQuestionType($questionType);
171  $this->renderExamples($tpl, $examples, $questionType);
172  }
173  }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
getExpressionTypeExamplesByQuestionType(string $questionType)
renderExamples(ilTemplate $tpl, array $examples, string $questionType)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderQuestSpecificLegendPart()

ilAssLacLegendGUI::renderQuestSpecificLegendPart ( ilTemplate  $tpl)
private
Parameters
ilTemplate$tpl

Definition at line 138 of file class.ilAssLacLegendGUI.php.

References getQuestionOBJ(), getQuestionTypeSpecificExpressions(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by get().

138  : void
139  {
140  $tpl->setVariable(
141  'QUEST_SPECIFIC_ELEMENTS_HEADER',
142  $this->lng->txt('qpl_lac_legend_header_quest_specific')
143  );
144 
145  foreach ($this->getQuestionTypeSpecificExpressions() as $expression => $description) {
146  $tpl->setCurrentBlock('quest_specific_elements');
147  $tpl->setVariable('QSE_ELEMENT', $expression);
148  $tpl->setVariable('QSE_DESCRIPTION', $this->lng->txt($description));
149  $tpl->setVariable('QSE_OPERATORS_TXT', $this->lng->txt('qpl_lac_legend_label_operators'));
150  $tpl->setVariable('QSE_OPERATORS', implode(', ', $this->getQuestionOBJ()->getOperators($expression)));
151  $tpl->parseCurrentBlock();
152  }
153  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionOBJ()

ilAssLacLegendGUI::setQuestionOBJ ( assQuestion  $questionOBJ)

Definition at line 77 of file class.ilAssLacLegendGUI.php.

References $questionOBJ.

77  : void
78  {
79  $this->questionOBJ = $questionOBJ;
80  }

Field Documentation

◆ $examplesByQuestionType

ilAssLacLegendGUI::$examplesByQuestionType
private
Initial value:
= [
'assQuestion' => ['PercentageResultExpression', 'EmptyAnswerExpression']

Definition at line 32 of file class.ilAssLacLegendGUI.php.

◆ $lng

ilAssLacLegendGUI::$lng
protected

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

Referenced by __construct().

◆ $pageTemplate

ilAssLacLegendGUI::$pageTemplate
protected

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

Referenced by __construct().

◆ $questionOBJ

ilAssLacLegendGUI::$questionOBJ
private

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

Referenced by getQuestionOBJ(), and setQuestionOBJ().

◆ $uiFactory

ilAssLacLegendGUI::$uiFactory
private

Definition at line 50 of file class.ilAssLacLegendGUI.php.

Referenced by __construct().


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