ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables 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 (iQuestionCondition $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 8 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 43 of file class.ilAssLacLegendGUI.php.

References $lng, $pageTemplate, and $uiFactory.

47  {
48  $this->pageTemplate = $pageTemplate;
49  $this->lng = $lng;
50  $this->uiFactory = $uiFactory;
51  $this->questionOBJ = null;
52  }

Member Function Documentation

◆ buildLangVarsByExampleCode()

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

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

Referenced by renderExamples().

168  : array
169  {
170  $langVar = 'lacex_' . $questionType . '_' . $exampleCode;
171 
172  return [$langVar . '_e', $langVar . '_d'];
173  }
+ Here is the caller graph for this function:

◆ get()

ilAssLacLegendGUI::get ( )
Returns

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

References $tpl, getTemplate(), renderCommonLegendPart(), renderQuestSpecificExamples(), and renderQuestSpecificLegendPart().

74  {
75  $this->pageTemplate->addCss('Modules/TestQuestionPool/templates/default/lac_legend.css');
76 
77  $tpl = $this->getTemplate();
78 
82 
83  return $this->uiFactory->modal()->lightbox([
84  $this->uiFactory->modal()->lightboxTextPage(
85  $tpl->get(),
86  $this->lng->txt('qpl_skill_point_eval_by_solution_compare')
87  ),
88  ]);
89  }
This describes commonalities between the different modals.
Definition: Modal.php:13
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 224 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().

224  : array
225  {
226  return [
227  iQuestionCondition::PercentageResultExpression => 'qpl_lac_desc_compare_with_quest_res',
228  iQuestionCondition::NumericResultExpression => 'qpl_lac_desc_compare_with_number',
229  iQuestionCondition::StringResultExpression => 'qpl_lac_desc_compare_with_text',
230  iQuestionCondition::MatchingResultExpression => 'qpl_lac_desc_compare_with_assignment',
231  iQuestionCondition::OrderingResultExpression => 'qpl_lac_desc_compare_with_sequence',
232  iQuestionCondition::NumberOfResultExpression => 'qpl_lac_desc_compare_with_answer_n',
233  iQuestionCondition::ExclusiveResultExpression => 'qpl_lac_desc_compare_with_exact_sequence',
234  iQuestionCondition::EmptyAnswerExpression => 'qpl_lac_desc_compare_answer_exist'
235  ];
236  }
+ Here is the caller graph for this function:

◆ getCommonElements()

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

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

Referenced by renderCommonLegendPart().

208  {
209  return [
210  '&' => $this->lng->txt('qpl_lac_desc_logical_and'),
211  '|' => $this->lng->txt('qpl_lac_desc_logical_or'),
212  '!' => $this->lng->txt('qpl_lac_desc_negation'),
213  '()' => $this->lng->txt('qpl_lac_desc_brackets'),
214  //'Qn' => $this->lng->txt('qpl_lac_desc_res_of_quest_n'),
215  //'Qn[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_quest_n'),
216  'R' => $this->lng->txt('qpl_lac_desc_res_of_cur_quest'),
217  'R[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_cur_quest')
218  ];
219  }
+ Here is the caller graph for this function:

◆ getExpressionTypeExamplesByQuestionType()

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

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

Referenced by renderQuestSpecificExamples().

242  : array
243  {
244  if (!isset($this->examplesByQuestionType[$questionType])) {
245  return [];
246  }
247 
248  return $this->examplesByQuestionType[$questionType];
249  }
+ Here is the caller graph for this function:

◆ getQuestionOBJ()

ilAssLacLegendGUI::getQuestionOBJ ( )
Returns
iQuestionCondition|null

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

References $questionOBJ.

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

58  {
59  return $this->questionOBJ;
60  }
Class iQuestionCondition.
+ Here is the caller graph for this function:

◆ getQuestionTypeSpecificExpressions()

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

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

References getAvailableExpressionTypes(), and getQuestionOBJ().

Referenced by renderQuestSpecificLegendPart().

191  : array
192  {
193  $availableExpressionTypes = $this->getAvailableExpressionTypes();
194 
195  $expressionTypes = [];
196 
197  foreach ($this->getQuestionOBJ()->getExpressionTypes() as $expressionType) {
198  $expressionTypes[$expressionType] = $availableExpressionTypes[$expressionType];
199  }
200 
201  return $expressionTypes;
202  }
+ 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 95 of file class.ilAssLacLegendGUI.php.

Referenced by get().

95  : ilTemplate
96  {
97  return new ilTemplate(
98  'tpl.qpl_logical_answer_compare_legend.html',
99  true,
100  true,
101  'Modules/TestQuestionPool'
102  );
103  }
+ Here is the caller graph for this function:

◆ renderCommonLegendPart()

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

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

References getCommonElements(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by get().

108  : void
109  {
110  $tpl->setVariable(
111  'COMMON_ELEMENTS_HEADER',
112  $this->lng->txt('qpl_lac_legend_header_common')
113  );
114 
115  foreach ($this->getCommonElements() as $element => $description) {
116  $tpl->setCurrentBlock('common_elements');
117  $tpl->setVariable('CE_ELEMENT', $element);
118  $tpl->setVariable('CE_DESCRIPTION', $description);
119  $tpl->parseCurrentBlock();
120  }
121  }
setVariable($variable, $value='')
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
+ 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 180 of file class.ilAssLacLegendGUI.php.

References ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by renderExamples().

180  : void
181  {
182  $tpl->setCurrentBlock('quest_specific_examples');
183  $tpl->setVariable('QSEX_ELEMENT', $this->lng->txt($langVarE));
184  $tpl->setVariable('QSEX_DESCRIPTION', $this->lng->txt($langVarD));
185  $tpl->parseCurrentBlock();
186  }
setVariable($variable, $value='')
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
+ 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 256 of file class.ilAssLacLegendGUI.php.

References buildLangVarsByExampleCode(), and renderExample().

Referenced by renderQuestSpecificExamples().

256  : void
257  {
258  foreach ($examples as $exampleCode) {
259  list($langVarE, $langVarD) = $this->buildLangVarsByExampleCode($questionType, $exampleCode);
260  $this->renderExample($tpl, $langVarE, $langVarD);
261  }
262  }
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 146 of file class.ilAssLacLegendGUI.php.

References getExpressionTypeExamplesByQuestionType(), getQuestionOBJ(), renderExamples(), and ilGlobalTemplateInterface\setVariable().

Referenced by get().

146  : void
147  {
148  $tpl->setVariable(
149  'QUEST_SPECIFIC_EXAMPLES_HEADER',
150  $this->lng->txt('lacex_example_header')
151  );
152 
153  $questionTypes = [
154  'assQuestion', $this->getQuestionOBJ()->getQuestionType()
155  ];
156 
157  foreach ($questionTypes as $questionType) {
158  $examples = $this->getExpressionTypeExamplesByQuestionType($questionType);
159  $this->renderExamples($tpl, $examples, $questionType);
160  }
161  }
setVariable($variable, $value='')
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 126 of file class.ilAssLacLegendGUI.php.

References getQuestionOBJ(), getQuestionTypeSpecificExpressions(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and ilGlobalTemplateInterface\setVariable().

Referenced by get().

126  : void
127  {
128  $tpl->setVariable(
129  'QUEST_SPECIFIC_ELEMENTS_HEADER',
130  $this->lng->txt('qpl_lac_legend_header_quest_specific')
131  );
132 
133  foreach ($this->getQuestionTypeSpecificExpressions() as $expression => $description) {
134  $tpl->setCurrentBlock('quest_specific_elements');
135  $tpl->setVariable('QSE_ELEMENT', $expression);
136  $tpl->setVariable('QSE_DESCRIPTION', $this->lng->txt($description));
137  $tpl->setVariable('QSE_OPERATORS_TXT', $this->lng->txt('qpl_lac_legend_label_operators'));
138  $tpl->setVariable('QSE_OPERATORS', implode(', ', $this->getQuestionOBJ()->getOperators($expression)));
139  $tpl->parseCurrentBlock();
140  }
141  }
setVariable($variable, $value='')
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt public...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionOBJ()

ilAssLacLegendGUI::setQuestionOBJ ( iQuestionCondition  $questionOBJ)
Parameters
iQuestionCondition$questionOBJ

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

References $questionOBJ.

65  : void
66  {
67  $this->questionOBJ = $questionOBJ;
68  }

Field Documentation

◆ $examplesByQuestionType

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

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

◆ $lng

ilAssLacLegendGUI::$lng
protected

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

Referenced by __construct().

◆ $pageTemplate

ilAssLacLegendGUI::$pageTemplate
protected

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

Referenced by __construct().

◆ $questionOBJ

ilAssLacLegendGUI::$questionOBJ
private

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

Referenced by getQuestionOBJ(), and setQuestionOBJ().

◆ $uiFactory

ilAssLacLegendGUI::$uiFactory
private

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

Referenced by __construct().


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