ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssLacLegendGUI Class Reference
+ Inheritance diagram for ilAssLacLegendGUI:
+ Collaboration diagram for ilAssLacLegendGUI:

Public Member Functions

 __construct (ilLanguage $lng, ilTemplate $tpl)
 
 getQuestionOBJ ()
 
 setQuestionOBJ (iQuestionCondition $questionOBJ)
 
 isInitialVisibilityEnabled ()
 
 setInitialVisibilityEnabled ($initialVisibilityEnabled)
 
 getHTML ()
 
 getTriggerElement ()
 
 getExpressionTypeExamplesByQuestionType ($questionType)
 
- Public Member Functions inherited from ilOverlayGUI
 __construct ($a_overlay_el_id)
 Constructor. More...
 
 setAnchor ($a_anchor_el_id, $a_ov_corner="tl", $a_anch_corner="bl")
 Set anchor element. More...
 
 setSize ($a_width="", $a_height="")
 Set size. More...
 
 setFixedCenter ($a_fixed_center=true)
 Set fixed center. More...
 
 setVisible ($a_visible=true)
 Set visible. More...
 
 setTrigger ($a_el_id, $a_event="click", $a_trigger_anchor_el_id=null)
 Set trigger element. More...
 
 setAutoHide ($a_val)
 Set auto hiding. More...
 
 getAutoHide ()
 Get auto_hide. More...
 
 setCloseElementId ($a_val)
 Set close element id. More...
 
 getCloseElementId ()
 Get close element id. More...
 
 getOnLoadCode ()
 Makes an existing HTML element an overlay. More...
 
 add ()
 Makes an existing HTML element an overlay. More...
 
 getTriggerOnLoadCode ( $a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center=false, $a_ov_corner="tl", $a_anch_corner="bl")
 Get trigger onload code. More...
 
 addTrigger ( $a_tr_id, $a_tr_event, $a_anchor_el_id, $a_center=false, $a_ov_corner="tl", $a_anch_corner="bl")
 Add trigger. More...
 

Protected Member Functions

 renderCloseIcon ($tpl)
 
 initOverlay ()
 
 getTemplate ()
 
 renderCommonLegendPart (ilTemplate $tpl)
 
 renderQuestSpecificLegendPart (ilTemplate $tpl)
 
 renderQuestSpecificExamples (ilTemplate $tpl)
 
 buildLangVarsByExampleCode ($questionType, $exampleCode)
 
 renderExample (ilTemplate $tpl, $langVarE, $langVarD)
 
 populateVisibilityCss (ilTemplate $tpl)
 
 populateTriggerDepencies (ilTemplate $tpl)
 
 getQuestionTypeSpecificExpressions ()
 
 getCommonElements ()
 
 getAvailableExpressionTypes ()
 
 renderExamples (ilTemplate $tpl, $examples, $questionType)
 

Protected Attributes

 $lng
 
 $tpl
 
- Protected Attributes inherited from ilOverlayGUI
 $tpl
 
 $width = ""
 
 $height = ""
 
 $fixed_center = false
 
 $visible = false
 
 $anchor_el_id = ""
 
 $anchor_ov_corner = ""
 
 $anchor_anch_corner = ""
 
 $auto_hide = false
 
 $close_el = null
 

Private Attributes

 $initialVisibilityEnabled
 
 $questionOBJ
 
 $examplesByQuestionType
 

Additional Inherited Members

- Static Public Member Functions inherited from ilOverlayGUI
static initJavascript ()
 Init javascript. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssLacLegendGUI::__construct ( ilLanguage  $lng,
ilTemplate  $tpl 
)

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

46 {
47 $this->lng = $lng;
48 $this->tpl = $tpl;
49
50 $this->initialVisibilityEnabled = false;
51
52 $this->questionOBJ = null;
53
54 parent::__construct('qpl_lac_legend');
55 }

References $lng, and $tpl.

Member Function Documentation

◆ buildLangVarsByExampleCode()

ilAssLacLegendGUI::buildLangVarsByExampleCode (   $questionType,
  $exampleCode 
)
protected

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

178 {
179 $langVar = 'lacex_' . $questionType . '_' . $exampleCode;
180 return array($langVar . '_e', $langVar . '_d');
181 }

Referenced by renderExamples().

+ Here is the caller graph for this function:

◆ getAvailableExpressionTypes()

ilAssLacLegendGUI::getAvailableExpressionTypes ( )
protected

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

256 {
257 return array(
258 iQuestionCondition::PercentageResultExpression => 'qpl_lac_desc_compare_with_quest_res',
259 iQuestionCondition::NumericResultExpression => 'qpl_lac_desc_compare_with_number',
260 iQuestionCondition::StringResultExpression => 'qpl_lac_desc_compare_with_text',
261 iQuestionCondition::MatchingResultExpression => 'qpl_lac_desc_compare_with_assignment',
262 iQuestionCondition::OrderingResultExpression => 'qpl_lac_desc_compare_with_sequence',
263 iQuestionCondition::NumberOfResultExpression => 'qpl_lac_desc_compare_with_answer_n',
264 iQuestionCondition::ExclusiveResultExpression => 'qpl_lac_desc_compare_with_exact_sequence',
265 iQuestionCondition::EmptyAnswerExpression => 'qpl_lac_desc_compare_answer_exist'
266 );
267 }

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 ( )
protected

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

242 {
243 return array(
244 '&' => $this->lng->txt('qpl_lac_desc_logical_and'),
245 '|' => $this->lng->txt('qpl_lac_desc_logical_or'),
246 '!' => $this->lng->txt('qpl_lac_desc_negation'),
247 '()' => $this->lng->txt('qpl_lac_desc_brackets'),
248 //'Qn' => $this->lng->txt('qpl_lac_desc_res_of_quest_n'),
249 //'Qn[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_quest_n'),
250 'R' => $this->lng->txt('qpl_lac_desc_res_of_cur_quest'),
251 'R[m]' => $this->lng->txt('qpl_lac_desc_res_of_answ_m_of_cur_quest')
252 );
253 }

Referenced by renderCommonLegendPart().

+ Here is the caller graph for this function:

◆ getExpressionTypeExamplesByQuestionType()

ilAssLacLegendGUI::getExpressionTypeExamplesByQuestionType (   $questionType)

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

270 {
271 if (!isset($this->examplesByQuestionType[$questionType])) {
272 return array();
273 }
274
275 return $this->examplesByQuestionType[$questionType];
276 }

Referenced by renderQuestSpecificExamples().

+ Here is the caller graph for this function:

◆ getHTML()

ilAssLacLegendGUI::getHTML ( )

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

78 {
79 $this->initOverlay();
80
81 $tpl = $this->getTemplate();
82
83 $this->renderCloseIcon($tpl);
87
90
91 return $tpl->get();
92 }
populateVisibilityCss(ilTemplate $tpl)
renderQuestSpecificExamples(ilTemplate $tpl)
renderCommonLegendPart(ilTemplate $tpl)
populateTriggerDepencies(ilTemplate $tpl)
renderQuestSpecificLegendPart(ilTemplate $tpl)

References $tpl, getTemplate(), initOverlay(), populateTriggerDepencies(), populateVisibilityCss(), renderCloseIcon(), renderCommonLegendPart(), renderQuestSpecificExamples(), and renderQuestSpecificLegendPart().

+ Here is the call graph for this function:

◆ getQuestionOBJ()

ilAssLacLegendGUI::getQuestionOBJ ( )

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 ( )
protected

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

229 {
230 $availableExpressionTypes = $this->getAvailableExpressionTypes();
231
232 $expressionTypes = array();
233
234 foreach ($this->getQuestionOBJ()->getExpressionTypes() as $expressionType) {
235 $expressionTypes[$expressionType] = $availableExpressionTypes[$expressionType];
236 }
237
238 return $expressionTypes;
239 }

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

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

119 {
120 return new ilTemplate(
121 'tpl.qpl_logical_answer_compare_legend.html',
122 true,
123 true,
124 'Modules/TestQuestionPool'
125 );
126 }
special template class to simplify handling of ITX/PEAR

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getTriggerElement()

ilAssLacLegendGUI::getTriggerElement ( )

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

224 {
225 return "<div id=\"qpl_lac_legend_trigger\"><a href=\"#\">" . $this->lng->txt("qpl_lac_legend_link") . "</a></div>";
226 }

◆ initOverlay()

ilAssLacLegendGUI::initOverlay ( )
protected

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

100 {
101 include_once 'Services/YUI/classes/class.ilYuiUtil.php';
103
104 $this->tpl->addCss('Modules/TestQuestionPool/templates/default/lac_legend.css');
105
106 //$this->setAnchor('fixed_content', 'tr', 'tr');
107 // we use css instead, does not hoppel over screen for initially visible overlays
108
109 //$this->setTrigger('lac_legend_toggle_btn', 'click');
110 // is done by own listener that also changes the toggle label
111
112 $this->setVisible($this->isInitialVisibilityEnabled());
113 $this->setAutoHide(false);
114
115 $this->add();
116 }
setVisible($a_visible=true)
Set visible.
setAutoHide($a_val)
Set auto hiding.
add()
Makes an existing HTML element an overlay.
static initOverlay(ilTemplate $a_main_tpl=null)
Init YUI Overlay module.

References ilOverlayGUI\add(), ilYuiUtil\initOverlay(), isInitialVisibilityEnabled(), ilOverlayGUI\setAutoHide(), and ilOverlayGUI\setVisible().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInitialVisibilityEnabled()

ilAssLacLegendGUI::isInitialVisibilityEnabled ( )

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

References $initialVisibilityEnabled.

Referenced by initOverlay(), and populateVisibilityCss().

+ Here is the caller graph for this function:

◆ populateTriggerDepencies()

ilAssLacLegendGUI::populateTriggerDepencies ( ilTemplate  $tpl)
protected

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

199 {
200 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignment.php';
201
202 $tpl->setVariable(
203 'TOGGLE_BTN_SHOW_LABEL',
204 $this->lng->txt('ass_lac_show_legend_btn')
205 );
206
207 $tpl->setVariable(
208 'TOGGLE_BTN_HIDE_LABEL',
209 $this->lng->txt('ass_lac_hide_legend_btn')
210 );
211
212 $tpl->setVariable(
213 'SKILL_POINT_EVAL_MODE_BY_RESULT',
215 );
216
217 $tpl->setVariable(
218 'SKILL_POINT_EVAL_MODE_BY_SOLUTION',
220 );
221 }

References $tpl, ilAssQuestionSkillAssignment\EVAL_MODE_BY_QUESTION_RESULT, and ilAssQuestionSkillAssignment\EVAL_MODE_BY_QUESTION_SOLUTION.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ populateVisibilityCss()

ilAssLacLegendGUI::populateVisibilityCss ( ilTemplate  $tpl)
protected

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

192 {
193 if (!$this->isInitialVisibilityEnabled()) {
194 $tpl->setVariable('CSS_DISPLAY_NONE', 'display:none;');
195 }
196 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:613

References isInitialVisibilityEnabled(), and HTML_Template_IT\setVariable().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderCloseIcon()

ilAssLacLegendGUI::renderCloseIcon (   $tpl)
protected

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

95 {
96 $tpl->setVariable('CLOSE_ICON', ilGlyphGUI::get(ilGlyphGUI::CLOSE));
97 }
static get($a_glyph, $a_text="")
Get glyph html.

References $tpl, ilGlyphGUI\CLOSE, and ilGlyphGUI\get().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderCommonLegendPart()

ilAssLacLegendGUI::renderCommonLegendPart ( ilTemplate  $tpl)
protected

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

129 {
130 $tpl->setVariable(
131 'COMMON_ELEMENTS_HEADER',
132 $this->lng->txt('qpl_lac_legend_header_common')
133 );
134
135 foreach ($this->getCommonElements() as $element => $description) {
136 $tpl->setCurrentBlock('common_elements');
137 $tpl->setVariable('CE_ELEMENT', $element);
138 $tpl->setVariable('CE_DESCRIPTION', $description);
139 $tpl->parseCurrentBlock();
140 }
141 }

References $description, $tpl, and getCommonElements().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderExample()

ilAssLacLegendGUI::renderExample ( ilTemplate  $tpl,
  $langVarE,
  $langVarD 
)
protected

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

184 {
185 $tpl->setCurrentBlock('quest_specific_examples');
186 $tpl->setVariable('QSEX_ELEMENT', $this->lng->txt($langVarE));
187 $tpl->setVariable('QSEX_DESCRIPTION', $this->lng->txt($langVarD));
188 $tpl->parseCurrentBlock();
189 }

References $tpl.

Referenced by renderExamples().

+ Here is the caller graph for this function:

◆ renderExamples()

ilAssLacLegendGUI::renderExamples ( ilTemplate  $tpl,
  $examples,
  $questionType 
)
protected
Parameters
ilTemplate$tpl
$examples
$questionType

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

284 {
285 foreach ($examples as $exampleCode) {
286 list($langVarE, $langVarD) = $this->buildLangVarsByExampleCode($questionType, $exampleCode);
287 $this->renderExample($tpl, $langVarE, $langVarD);
288 }
289 }
buildLangVarsByExampleCode($questionType, $exampleCode)
renderExample(ilTemplate $tpl, $langVarE, $langVarD)

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)
protected

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

161 {
162 $tpl->setVariable(
163 'QUEST_SPECIFIC_EXAMPLES_HEADER',
164 $this->lng->txt('lacex_example_header')
165 );
166
167 $questionTypes = array(
168 'assQuestion', $this->getQuestionOBJ()->getQuestionType()
169 );
170
171 foreach ($questionTypes as $questionType) {
172 $examples = $this->getExpressionTypeExamplesByQuestionType($questionType);
173 $this->renderExamples($tpl, $examples, $questionType);
174 }
175 }
getExpressionTypeExamplesByQuestionType($questionType)
renderExamples(ilTemplate $tpl, $examples, $questionType)

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

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderQuestSpecificLegendPart()

ilAssLacLegendGUI::renderQuestSpecificLegendPart ( ilTemplate  $tpl)
protected

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

144 {
145 $tpl->setVariable(
146 'QUEST_SPECIFIC_ELEMENTS_HEADER',
147 $this->lng->txt('qpl_lac_legend_header_quest_specific')
148 );
149
150 foreach ($this->getQuestionTypeSpecificExpressions() as $expression => $description) {
151 $tpl->setCurrentBlock('quest_specific_elements');
152 $tpl->setVariable('QSE_ELEMENT', $expression);
153 $tpl->setVariable('QSE_DESCRIPTION', $this->lng->txt($description));
154 $tpl->setVariable('QSE_OPERATORS_TXT', $this->lng->txt('qpl_lac_legend_label_operators'));
155 $tpl->setVariable('QSE_OPERATORS', implode(', ', $this->getQuestionOBJ()->getOperators($expression)));
156 $tpl->parseCurrentBlock();
157 }
158 }

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

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInitialVisibilityEnabled()

ilAssLacLegendGUI::setInitialVisibilityEnabled (   $initialVisibilityEnabled)

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

73 {
74 $this->initialVisibilityEnabled = $initialVisibilityEnabled;
75 }

References $initialVisibilityEnabled.

◆ setQuestionOBJ()

ilAssLacLegendGUI::setQuestionOBJ ( iQuestionCondition  $questionOBJ)

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

63 {
64 $this->questionOBJ = $questionOBJ;
65 }

References $questionOBJ.

Field Documentation

◆ $examplesByQuestionType

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

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

◆ $initialVisibilityEnabled

ilAssLacLegendGUI::$initialVisibilityEnabled
private

◆ $lng

ilAssLacLegendGUI::$lng
protected

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

Referenced by __construct().

◆ $questionOBJ

ilAssLacLegendGUI::$questionOBJ
private

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

Referenced by getQuestionOBJ(), and setQuestionOBJ().

◆ $tpl


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