ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestQuestionSideListGUI Class Reference
+ Collaboration diagram for ilTestQuestionSideListGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $lng)
 
 getTargetGUI ()
 
 setTargetGUI ($targetGUI)
 
 getQuestionSummaryData ()
 
 setQuestionSummaryData ($questionSummaryData)
 
 getCurrentSequenceElement ()
 
 setCurrentSequenceElement ($currentSequenceElement)
 
 getCurrentPresentationMode ()
 
 setCurrentPresentationMode ($currentPresentationMode)
 
 isDisabled ()
 
 setDisabled ($disabled)
 
 getHTML ()
 

Protected Attributes

 $ctrl
 
 $lng
 

Private Member Functions

 buildPanel ()
 
 renderList ()
 
 buildLink ($sequenceElement)
 

Private Attributes

 $targetGUI
 
 $questionSummaryData
 
 $currentSequenceElement
 
 $currentPresentationMode
 
 $disabled
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestQuestionSideListGUI::__construct ( ilCtrl  $ctrl,
ilLanguage  $lng 
)
Parameters
ilCtrl$ctrl
ilLanguage$lng

Definition at line 52 of file class.ilTestQuestionSideListGUI.php.

53 {
54 $this->ctrl = $ctrl;
55 $this->lng = $lng;
56
57 $this->questionSummaryData = array();
58 $this->currentSequenceElement = null;
59 $this->disabled = false;
60 }

References $ctrl, and $lng.

Member Function Documentation

◆ buildLink()

ilTestQuestionSideListGUI::buildLink (   $sequenceElement)
private
Parameters
$row
Returns
string

Definition at line 225 of file class.ilTestQuestionSideListGUI.php.

226 {
227 $this->ctrl->setParameter(
228 $this->getTargetGUI(), 'pmode', ''
229 );
230
231 $this->ctrl->setParameter(
232 $this->getTargetGUI(), 'sequence', $sequenceElement
233 );
234
235 $href = $this->ctrl->getLinkTarget($this->getTargetGUI(), ilTestPlayerCommands::SHOW_QUESTION);
236
237 $this->ctrl->setParameter(
238 $this->getTargetGUI(), 'pmode', $this->getCurrentPresentationMode()
239 );
240 $this->ctrl->setParameter(
241 $this->getTargetGUI(), 'sequence', $this->getCurrentSequenceElement()
242 );
243 return $href;
244 }

References getCurrentPresentationMode(), getCurrentSequenceElement(), getTargetGUI(), and ilTestPlayerCommands\SHOW_QUESTION.

Referenced by renderList().

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

◆ buildPanel()

ilTestQuestionSideListGUI::buildPanel ( )
private
Returns
ilPanelGUI

Definition at line 145 of file class.ilTestQuestionSideListGUI.php.

146 {
147 require_once 'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
148 $panel = ilPanelGUI::getInstance();
149 $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_SUBHEADING);
150 $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
151 $panel->setHeading($this->lng->txt('list_of_questions'));
152 return $panel;
153 }
const PANEL_STYLE_SECONDARY
const HEADING_STYLE_SUBHEADING
static getInstance()
Get instance.

References ilPanelGUI\getInstance(), ilPanelGUI\HEADING_STYLE_SUBHEADING, and ilPanelGUI\PANEL_STYLE_SECONDARY.

Referenced by getHTML().

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

◆ getCurrentPresentationMode()

ilTestQuestionSideListGUI::getCurrentPresentationMode ( )
Returns
string

Definition at line 113 of file class.ilTestQuestionSideListGUI.php.

References $currentPresentationMode.

Referenced by buildLink().

+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestQuestionSideListGUI::getCurrentSequenceElement ( )
Returns
int

Definition at line 97 of file class.ilTestQuestionSideListGUI.php.

References $currentSequenceElement.

Referenced by buildLink(), and renderList().

+ Here is the caller graph for this function:

◆ getHTML()

ilTestQuestionSideListGUI::getHTML ( )
Returns
string

Definition at line 214 of file class.ilTestQuestionSideListGUI.php.

215 {
216 $panel = $this->buildPanel();
217 $panel->setBody($this->renderList());
218 return $panel->getHTML();
219 }

References buildPanel(), and renderList().

+ Here is the call graph for this function:

◆ getQuestionSummaryData()

ilTestQuestionSideListGUI::getQuestionSummaryData ( )
Returns
array

Definition at line 81 of file class.ilTestQuestionSideListGUI.php.

References $questionSummaryData.

Referenced by renderList().

+ Here is the caller graph for this function:

◆ getTargetGUI()

ilTestQuestionSideListGUI::getTargetGUI ( )
Returns
ilTestPlayerAbstractGUI

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

References $targetGUI.

Referenced by buildLink().

+ Here is the caller graph for this function:

◆ isDisabled()

ilTestQuestionSideListGUI::isDisabled ( )
Returns
boolean

Definition at line 129 of file class.ilTestQuestionSideListGUI.php.

References $disabled.

◆ renderList()

ilTestQuestionSideListGUI::renderList ( )
private
Returns
string

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

159 {
160 $tpl = new ilTemplate('tpl.il_as_tst_list_of_questions_short.html', true, true, 'Modules/Test');
161
162 foreach( $this->getQuestionSummaryData() as $row )
163 {
164 $title = ilUtil::prepareFormOutput($row['title']);
165
166 if( strlen($row['description']) )
167 {
168 $description = " title=\"{$row['description']}\" ";
169 }
170 else
171 {
172 $description = "";
173 }
174
175 $active = ($row['sequence'] == $this->getCurrentSequenceElement()) ? ' active' : '';
176
177 $class = (
178 $row['worked_through'] ? 'answered'.$active : 'unanswered'.$active
179 );
180
181 /*
182 if( $this->isDisabled() )
183 {
184 $tpl->setCurrentBlock('disabled_entry');
185 $tpl->setVariable('CLASS', $class);
186 $tpl->setVariable('ITEM', $title);
187 $tpl->setVariable('DESCRIPTION', $description);
188 $tpl->parseCurrentBlock();
189 }
190 else
191 {
192 */
193 $tpl->setCurrentBlock('linked_entry');
194 $tpl->setVariable('HREF', $this->buildLink($row['sequence']));
195 $tpl->setVariable('NEXTCMD', ilTestPlayerCommands::SHOW_QUESTION);
196 $tpl->setVariable('NEXTSEQ', $row['sequence']);
197 $tpl->setVariable('CLASS', $class);
198 $tpl->setVariable('ITEM', $title);
199 $tpl->setVariable("DESCRIPTION", $description);
200 $tpl->parseCurrentBlock();
201 /*
202 }
203 */
204
205 $tpl->setCurrentBlock('item');
206 }
207
208 return $tpl->get();
209 }
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $row, $tpl, buildLink(), getCurrentSequenceElement(), getQuestionSummaryData(), ilUtil\prepareFormOutput(), and ilTestPlayerCommands\SHOW_QUESTION.

Referenced by getHTML().

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

◆ setCurrentPresentationMode()

ilTestQuestionSideListGUI::setCurrentPresentationMode (   $currentPresentationMode)
Parameters
string$currentPresentationMode

Definition at line 121 of file class.ilTestQuestionSideListGUI.php.

122 {
123 $this->currentPresentationMode = $currentPresentationMode;
124 }

References $currentPresentationMode.

◆ setCurrentSequenceElement()

ilTestQuestionSideListGUI::setCurrentSequenceElement (   $currentSequenceElement)
Parameters
int$currentSequenceElement

Definition at line 105 of file class.ilTestQuestionSideListGUI.php.

106 {
107 $this->currentSequenceElement = $currentSequenceElement;
108 }

References $currentSequenceElement.

◆ setDisabled()

ilTestQuestionSideListGUI::setDisabled (   $disabled)
Parameters
boolean$disabled

Definition at line 137 of file class.ilTestQuestionSideListGUI.php.

138 {
139 $this->disabled = $disabled;
140 }

References $disabled.

◆ setQuestionSummaryData()

ilTestQuestionSideListGUI::setQuestionSummaryData (   $questionSummaryData)
Parameters
array$questionSummaryData

Definition at line 89 of file class.ilTestQuestionSideListGUI.php.

90 {
91 $this->questionSummaryData = $questionSummaryData;
92 }

References $questionSummaryData.

◆ setTargetGUI()

ilTestQuestionSideListGUI::setTargetGUI (   $targetGUI)
Parameters
ilTestPlayerAbstractGUI$targetGUI

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

74 {
75 $this->targetGUI = $targetGUI;
76 }

References $targetGUI.

Field Documentation

◆ $ctrl

ilTestQuestionSideListGUI::$ctrl
protected

Definition at line 16 of file class.ilTestQuestionSideListGUI.php.

Referenced by __construct().

◆ $currentPresentationMode

ilTestQuestionSideListGUI::$currentPresentationMode
private

◆ $currentSequenceElement

ilTestQuestionSideListGUI::$currentSequenceElement
private

◆ $disabled

ilTestQuestionSideListGUI::$disabled
private

Definition at line 46 of file class.ilTestQuestionSideListGUI.php.

Referenced by isDisabled(), and setDisabled().

◆ $lng

ilTestQuestionSideListGUI::$lng
protected

Definition at line 21 of file class.ilTestQuestionSideListGUI.php.

Referenced by __construct().

◆ $questionSummaryData

ilTestQuestionSideListGUI::$questionSummaryData
private

◆ $targetGUI

ilTestQuestionSideListGUI::$targetGUI
private

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

Referenced by getTargetGUI(), and setTargetGUI().


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