ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 $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 174 of file class.ilAssLacLegendGUI.php.

175 {
176 $langVar = 'lacex_'.$questionType.'_'.$exampleCode;
177 return array($langVar.'_e', $langVar.'_d');
178 }

Referenced by renderExamples().

+ Here is the caller graph for this function:

◆ getAvailableExpressionTypes()

ilAssLacLegendGUI::getAvailableExpressionTypes ( )
protected

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

251 {
252 return array(
253 iQuestionCondition::PercentageResultExpression => 'qpl_lac_desc_compare_with_quest_res',
254 iQuestionCondition::NumericResultExpression => 'qpl_lac_desc_compare_with_number',
255 iQuestionCondition::StringResultExpression => 'qpl_lac_desc_compare_with_text',
256 iQuestionCondition::MatchingResultExpression => 'qpl_lac_desc_compare_with_assignment',
257 iQuestionCondition::OrderingResultExpression => 'qpl_lac_desc_compare_with_sequence',
258 iQuestionCondition::NumberOfResultExpression => 'qpl_lac_desc_compare_with_answer_n',
259 iQuestionCondition::ExclusiveResultExpression => 'qpl_lac_desc_compare_with_exact_sequence',
260 iQuestionCondition::EmptyAnswerExpression => 'qpl_lac_desc_compare_answer_exist'
261 );
262 }

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 236 of file class.ilAssLacLegendGUI.php.

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

Referenced by renderCommonLegendPart().

+ Here is the caller graph for this function:

◆ getExpressionTypeExamplesByQuestionType()

ilAssLacLegendGUI::getExpressionTypeExamplesByQuestionType (   $questionType)

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

265 {
266 if( !isset($this->examplesByQuestionType[$questionType]) )
267 {
268 return array();
269 }
270
271 return $this->examplesByQuestionType[$questionType];
272 }

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 222 of file class.ilAssLacLegendGUI.php.

223 {
224 $availableExpressionTypes = $this->getAvailableExpressionTypes();
225
226 $expressionTypes = array();
227
228 foreach($this->getQuestionOBJ()->getExpressionTypes() as $expressionType)
229 {
230 $expressionTypes[$expressionType] = $availableExpressionTypes[$expressionType];
231 }
232
233 return $expressionTypes;
234 }

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', true, true, 'Modules/TestQuestionPool'
122 );
123 }
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 217 of file class.ilAssLacLegendGUI.php.

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

◆ 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()
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 196 of file class.ilAssLacLegendGUI.php.

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

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 188 of file class.ilAssLacLegendGUI.php.

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

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 125 of file class.ilAssLacLegendGUI.php.

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

References $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 180 of file class.ilAssLacLegendGUI.php.

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,
  $examples,
  $questionType 
)
protected
Parameters
ilTemplate$tpl
$examples
$questionType

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

280 {
281 foreach($examples as $exampleCode)
282 {
283 list($langVarE, $langVarD) = $this->buildLangVarsByExampleCode($questionType, $exampleCode);
284 $this->renderExample($tpl, $langVarE, $langVarD);
285 }
286 }
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 157 of file class.ilAssLacLegendGUI.php.

158 {
159 $tpl->setVariable(
160 'QUEST_SPECIFIC_EXAMPLES_HEADER', $this->lng->txt('lacex_example_header')
161 );
162
163 $questionTypes = array(
164 'assQuestion', $this->getQuestionOBJ()->getQuestionType()
165 );
166
167 foreach($questionTypes as $questionType)
168 {
169 $examples = $this->getExpressionTypeExamplesByQuestionType($questionType);
170 $this->renderExamples($tpl, $examples, $questionType);
171 }
172 }
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 140 of file class.ilAssLacLegendGUI.php.

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

References $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: