ILIAS  release_7 Revision v7.30-3-g800a261c036
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 }
disabled()
Example showing how to plug a disabled checkbox into a form.
Definition: disabled.php:5

References $ctrl, $lng, and disabled().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildLink()

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

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

229 {
230 $this->ctrl->setParameter(
231 $this->getTargetGUI(),
232 'pmode',
233 ''
234 );
235
236 $this->ctrl->setParameter(
237 $this->getTargetGUI(),
238 'sequence',
239 $sequenceElement
240 );
241
242 $href = $this->ctrl->getLinkTarget($this->getTargetGUI(), ilTestPlayerCommands::SHOW_QUESTION);
243
244 $this->ctrl->setParameter(
245 $this->getTargetGUI(),
246 'pmode',
248 );
249 $this->ctrl->setParameter(
250 $this->getTargetGUI(),
251 'sequence',
253 );
254 return $href;
255 }

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';
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.
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:138

References $panel, 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 217 of file class.ilTestQuestionSideListGUI.php.

218 {
219 $panel = $this->buildPanel();
220 $panel->setBody($this->renderList());
221 return $panel->getHTML();
222 }

References $panel, 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.

Referenced by renderList().

+ Here is the caller graph for this function:

◆ 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 $title = ilUtil::prepareFormOutput($row['title']);
164
165 if (strlen($row['description'])) {
166 $description = " title=\"" . htmlspecialchars($row['description']) . "\" ";
167 } else {
168 $description = "";
169 }
170
171 $active = ($row['sequence'] == $this->getCurrentSequenceElement()) ? ' active' : '';
172
173 $class = (
174 $row['worked_through'] ? 'answered' . $active : 'unanswered' . $active
175 );
176
177 $headerclass = ($row['sequence'] == $this->getCurrentSequenceElement()) ? 'bold' : '';
178
179 if ($row['marked']) {
180 $tpl->setCurrentBlock("mark_icon");
181 $tpl->setVariable("ICON_SRC", ilUtil::getImagePath('marked.svg'));
182 $tpl->setVariable("ICON_TEXT", $this->lng->txt('tst_question_marked'));
183 $tpl->setVariable("ICON_CLASS", 'ilTestMarkQuestionIcon');
184 $tpl->parseCurrentBlock();
185 }
186
187 if ($this->isDisabled() || $row['disabled']) {
188 $tpl->setCurrentBlock('disabled_entry');
189 $tpl->setVariable('CLASS', $class);
190 $tpl->setVariable('HEADERCLASS', $headerclass);
191 $tpl->setVariable('ITEM', $title);
192 $tpl->setVariable('DESCRIPTION', $description);
193 $tpl->parseCurrentBlock();
194 } else {
195 // fau: testNav - show mark icon in side list
196 // fau.
197 $tpl->setCurrentBlock('linked_entry');
198 $tpl->setVariable('HREF', $this->buildLink($row['sequence']));
199 $tpl->setVariable('NEXTCMD', ilTestPlayerCommands::SHOW_QUESTION);
200 $tpl->setVariable('NEXTSEQ', $row['sequence']);
201 $tpl->setVariable('HEADERCLASS', $headerclass);
202 $tpl->setVariable('CLASS', $class);
203 $tpl->setVariable('ITEM', $title);
204 $tpl->setVariable("DESCRIPTION", $description);
205 $tpl->parseCurrentBlock();
206 }
207
208 $tpl->setCurrentBlock('item');
209 }
210
211 return $tpl->get();
212 }
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $tpl, buildLink(), getCurrentSequenceElement(), ilUtil\getImagePath(), getQuestionSummaryData(), isDisabled(), 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, and disabled().

+ Here is the call graph for this function:

◆ 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: