ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

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

References $lng, $pageTemplate, and $uiFactory.

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.

168 : array
169 {
170 $langVar = 'lacex_' . $questionType . '_' . $exampleCode;
171
172 return [$langVar . '_e', $langVar . '_d'];
173 }

Referenced by renderExamples().

+ Here is the caller graph for this function:

◆ get()

ilAssLacLegendGUI::get ( )
Returns
\ILIAS\UI\Component\Modal\Modal

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

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 }
renderQuestSpecificExamples(ilTemplate $tpl)
renderCommonLegendPart(ilTemplate $tpl)
renderQuestSpecificLegendPart(ilTemplate $tpl)
This describes commonalities between the different modals.
Definition: Modal.php:14
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

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

+ 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.

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 }

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

Referenced by getQuestionTypeSpecificExpressions().

+ 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.

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 }

Referenced by renderCommonLegendPart().

+ 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.

242 : array
243 {
244 if (!isset($this->examplesByQuestionType[$questionType])) {
245 return [];
246 }
247
248 return $this->examplesByQuestionType[$questionType];
249 }

Referenced by renderQuestSpecificExamples().

+ 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().

+ 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.

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 }

References getAvailableExpressionTypes(), and getQuestionOBJ().

Referenced by renderQuestSpecificLegendPart().

+ 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.

96 {
97 return new ilTemplate(
98 'tpl.qpl_logical_answer_compare_legend.html',
99 true,
100 true,
101 'Modules/TestQuestionPool'
102 );
103 }
special template class to simplify handling of ITX/PEAR

Referenced by get().

+ 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.

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 }

References $tpl, and getCommonElements().

Referenced by get().

+ 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.

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 }

References $tpl.

Referenced by renderExamples().

+ 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.

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)

References buildLangVarsByExampleCode(), and renderExample().

Referenced by renderQuestSpecificExamples().

+ 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.

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 }
getExpressionTypeExamplesByQuestionType(string $questionType)
renderExamples(ilTemplate $tpl, array $examples, string $questionType)

References $tpl, getExpressionTypeExamplesByQuestionType(), getQuestionOBJ(), and renderExamples().

Referenced by get().

+ 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.

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 }

References $tpl, getQuestionOBJ(), and getQuestionTypeSpecificExpressions().

Referenced by get().

+ 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.

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

References $questionOBJ.

Field Documentation

◆ $examplesByQuestionType

ilAssLacLegendGUI::$examplesByQuestionType
private
Initial value:
= [
'assQuestion' => ['PercentageResultExpression', 'EmptyAnswerExpression'],
'assSingleChoice' => ['NumberOfResultExpression'],
'assMultipleChoice' => ['NumberOfResultExpression', 'ExclusiveResultExpression'],
'assErrorText' => ['NumberOfResultExpression', 'ExclusiveResultExpression'],
'assImagemapQuestion' => ['NumberOfResultExpression', 'ExclusiveResultExpression'],
'assNumeric' => ['NumericResultExpression'],
'assOrderingQuestion' => ['OrderingResultExpression'],
'assOrderingHorizontal' => ['OrderingResultExpression'],
'assMatchingQuestion' => ['MatchingResultExpression'],
'assTextSubset' => ['StringResultExpression'],
'assFormulaQuestion' => ['NumericResultExpression'],
'assClozeTest' => [
'StringResultExpression_1', 'StringResultExpression_2',
'NumberOfResultExpression', 'NumericResultExpression'
],
]

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: