ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 25 of file class.ilTestQuestionSideListGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ctrl, $lng, ILIAS\Repository\ctrl(), ILIAS\UI\examples\Input\Field\Checkbox\disabled(), and ILIAS\Repository\lng().

67  {
68  $this->ctrl = $ctrl;
69  $this->lng = $lng;
70 
71  $this->questionSummaryData = array();
72  $this->currentSequenceElement = null;
73  $this->disabled = false;
74  }
disabled()
Example showing how to plug a disabled checkbox into a form.
Definition: disabled.php:10
+ Here is the call graph for this function:

Member Function Documentation

◆ buildLink()

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

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

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

Referenced by renderList().

242  : string
243  {
244  $this->ctrl->setParameter(
245  $this->getTargetGUI(),
246  'pmode',
247  ''
248  );
249 
250  $this->ctrl->setParameter(
251  $this->getTargetGUI(),
252  'sequence',
253  $sequenceElement
254  );
255 
256  $href = $this->ctrl->getLinkTarget($this->getTargetGUI(), ilTestPlayerCommands::SHOW_QUESTION);
257 
258  $this->ctrl->setParameter(
259  $this->getTargetGUI(),
260  'pmode',
262  );
263  $this->ctrl->setParameter(
264  $this->getTargetGUI(),
265  'sequence',
267  );
268  return $href;
269  }
+ 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 159 of file class.ilTestQuestionSideListGUI.php.

References $panel, ilPanelGUI\getInstance(), ilPanelGUI\HEADING_STYLE_SUBHEADING, ILIAS\Repository\lng(), and ilPanelGUI\PANEL_STYLE_SECONDARY.

Referenced by getHTML().

159  : ilPanelGUI
160  {
161  require_once 'Services/UIComponent/Panel/classes/class.ilPanelGUI.php';
165  $panel->setHeading($this->lng->txt('list_of_questions'));
166  return $panel;
167  }
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const HEADING_STYLE_SUBHEADING
static getInstance()
const PANEL_STYLE_SECONDARY
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentPresentationMode()

ilTestQuestionSideListGUI::getCurrentPresentationMode ( )
Returns
string

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

References $currentPresentationMode.

Referenced by buildLink().

127  : string
128  {
130  }
+ Here is the caller graph for this function:

◆ getCurrentSequenceElement()

ilTestQuestionSideListGUI::getCurrentSequenceElement ( )
Returns
int

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

References $currentSequenceElement.

Referenced by buildLink(), and renderList().

111  : ?int
112  {
114  }
+ Here is the caller graph for this function:

◆ getHTML()

ilTestQuestionSideListGUI::getHTML ( )
Returns
string

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

References $panel, buildPanel(), and renderList().

231  : string
232  {
233  $panel = $this->buildPanel();
234  $panel->setBody($this->renderList());
235  return $panel->getHTML();
236  }
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
+ Here is the call graph for this function:

◆ getQuestionSummaryData()

ilTestQuestionSideListGUI::getQuestionSummaryData ( )
Returns
array

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

References $questionSummaryData.

Referenced by renderList().

95  : array
96  {
98  }
+ Here is the caller graph for this function:

◆ getTargetGUI()

ilTestQuestionSideListGUI::getTargetGUI ( )
Returns
ilTestPlayerAbstractGUI

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

References $targetGUI.

Referenced by buildLink().

80  {
81  return $this->targetGUI;
82  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ isDisabled()

ilTestQuestionSideListGUI::isDisabled ( )
Returns
boolean

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

References $disabled.

Referenced by renderList().

143  : bool
144  {
145  return $this->disabled;
146  }
+ Here is the caller graph for this function:

◆ renderList()

ilTestQuestionSideListGUI::renderList ( )
private
Returns
string

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

References $tpl, buildLink(), getCurrentSequenceElement(), ilUtil\getImagePath(), getQuestionSummaryData(), isDisabled(), ILIAS\Repository\lng(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilTestPlayerCommands\SHOW_QUESTION.

Referenced by getHTML().

172  : string
173  {
174  $tpl = new ilTemplate('tpl.il_as_tst_list_of_questions_short.html', true, true, 'Modules/Test');
175 
176  foreach ($this->getQuestionSummaryData() as $row) {
177  $title = ilLegacyFormElementsUtil::prepareFormOutput($row['title']);
178 
179  if (strlen($row['description'])) {
180  $description = " title=\"" . htmlspecialchars($row['description']) . "\" ";
181  } else {
182  $description = "";
183  }
184 
185  $active = ($row['sequence'] == $this->getCurrentSequenceElement()) ? ' active' : '';
186 
187  $class = (
188  $row['worked_through'] ? 'answered' . $active : 'unanswered' . $active
189  );
190 
191  $headerclass = ($row['sequence'] == $this->getCurrentSequenceElement()) ? 'bold' : '';
192 
193  if ($row['marked']) {
194  $tpl->setCurrentBlock("mark_icon");
195  $tpl->setVariable("ICON_SRC", ilUtil::getImagePath('marked.svg'));
196  $tpl->setVariable("ICON_TEXT", $this->lng->txt('tst_question_marked'));
197  $tpl->setVariable("ICON_CLASS", 'ilTestMarkQuestionIcon');
198  $tpl->parseCurrentBlock();
199  }
200 
201  if ($this->isDisabled() || $row['disabled']) {
202  $tpl->setCurrentBlock('disabled_entry');
203  $tpl->setVariable('CLASS', $class);
204  $tpl->setVariable('HEADERCLASS', $headerclass);
205  $tpl->setVariable('ITEM', $title);
206  $tpl->setVariable('DESCRIPTION', $description);
207  $tpl->parseCurrentBlock();
208  } else {
209  // fau: testNav - show mark icon in side list
210  // fau.
211  $tpl->setCurrentBlock('linked_entry');
212  $tpl->setVariable('HREF', $this->buildLink($row['sequence']));
213  $tpl->setVariable('NEXTCMD', ilTestPlayerCommands::SHOW_QUESTION);
214  $tpl->setVariable('NEXTSEQ', $row['sequence']);
215  $tpl->setVariable('HEADERCLASS', $headerclass);
216  $tpl->setVariable('CLASS', $class);
217  $tpl->setVariable('ITEM', $title);
218  $tpl->setVariable("DESCRIPTION", $description);
219  $tpl->parseCurrentBlock();
220  }
221 
222  $tpl->setCurrentBlock('item');
223  }
224 
225  return $tpl->get();
226  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, bool $a_strip=false)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ 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 135 of file class.ilTestQuestionSideListGUI.php.

References $currentPresentationMode.

136  {
137  $this->currentPresentationMode = $currentPresentationMode;
138  }

◆ setCurrentSequenceElement()

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

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

References $currentSequenceElement.

120  {
121  $this->currentSequenceElement = $currentSequenceElement;
122  }

◆ setDisabled()

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

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

References $disabled, and ILIAS\UI\examples\Input\Field\Checkbox\disabled().

152  {
153  $this->disabled = $disabled;
154  }
disabled()
Example showing how to plug a disabled checkbox into a form.
Definition: disabled.php:10
+ Here is the call graph for this function:

◆ setQuestionSummaryData()

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

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

References $questionSummaryData.

104  {
105  $this->questionSummaryData = $questionSummaryData;
106  }

◆ setTargetGUI()

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

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

References $targetGUI.

88  {
89  $this->targetGUI = $targetGUI;
90  }

Field Documentation

◆ $ctrl

ilTestQuestionSideListGUI::$ctrl
protected

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

Referenced by __construct().

◆ $currentPresentationMode

ilTestQuestionSideListGUI::$currentPresentationMode
private

◆ $currentSequenceElement

ilTestQuestionSideListGUI::$currentSequenceElement
private

◆ $disabled

ilTestQuestionSideListGUI::$disabled
private

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

Referenced by isDisabled(), and setDisabled().

◆ $lng

ilTestQuestionSideListGUI::$lng
protected

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

Referenced by __construct().

◆ $questionSummaryData

ilTestQuestionSideListGUI::$questionSummaryData
private

◆ $targetGUI

ilTestQuestionSideListGUI::$targetGUI
private

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

Referenced by getTargetGUI(), and setTargetGUI().


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