ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssQuestionHintPageObjectCommandForwarder Class Reference
+ Inheritance diagram for ilAssQuestionHintPageObjectCommandForwarder:
+ Collaboration diagram for ilAssQuestionHintPageObjectCommandForwarder:

Public Member Functions

 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
 Constructor. More...
 
 forward ()
 forward method More...
 
 getPresentationMode ()
 getter for presentation mode More...
 
 setPresentationMode ($presentationMode)
 setter for presentation mode More...
 
- Public Member Functions inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 __construct (protected assQuestion $questionOBJ, protected readonly ilCtrl $ctrl, protected readonly ilTabsGUI $tabs, protected ilLanguage $lng)
 Constructor. More...
 
 forward ()
 this is the actual forward method that is to be implemented by derived forwarder classes More...
 

Data Fields

const PRESENTATION_MODE_AUTHOR = 'PRESENTATION_MODE_AUTHOR'
 presentation mode for authoring More...
 
const PRESENTATION_MODE_PREVIEW = 'PRESENTATION_MODE_PREVIEW'
 presentation mode for authoring More...
 
const PRESENTATION_MODE_REQUEST = 'PRESENTATION_MODE_REQUEST'
 presentation mode for requesting More...
 

Protected Member Functions

 getPageObjectGUI ($pageObjectType, $pageObjectId)
 instantiates, initialises and returns a page object gui object More...
 
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with giben type/id More...
 
- Protected Member Functions inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with giben type/id More...
 
 getPageObjectGUI ($pageObjectType, $pageObjectId)
 instantiates, initialises and returns a page object gui object More...
 

Protected Attributes

 $presentationMode
 
 $questionHint
 
- Protected Attributes inherited from ilAssQuestionAbstractPageObjectCommandForwarder
RequestDataCollector $request
 

Private Member Functions

 buildPreviewPresentationPageObjectGUI ()
 forwards the command to page object gui for author presentation More...
 
 buildRequestPresentationPageObjectGUI ()
 forwards the command to page object gui for author presentation More...
 
 buildAuthorPresentationPageObjectGUI ()
 forwards the command to page object gui for author presentation More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionHintPageObjectCommandForwarder::__construct ( assQuestion  $questionOBJ,
ilCtrl  $ctrl,
ilTabsGUI  $tabs,
ilLanguage  $lng 
)

Constructor.

public

Parameters
assQuestion$questionOBJ
ilCtrl$ctrl
ilTabsGUI$tabs
ilLanguage$lng

Definition at line 68 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilAssQuestionHintsGUI\CMD_SHOW_LIST, ILIAS\Repository\ctrl(), and ILIAS\Repository\int().

69  {
70  global $DIC;
71  $main_tpl = $DIC->ui()->mainTemplate();
72  parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
73 
74  $this->questionHint = new ilAssQuestionHint();
75 
76  if (!$this->request->isset('hint_id') || !(int) $this->request->raw('hint_id') || !$this->questionHint->load((int) $this->request->raw('hint_id'))) {
77  $main_tpl->setOnScreenMessage('failure', 'invalid hint id given: ' . (int) $this->request->raw('hint_id'), true);
78  $this->ctrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
79  }
80  }
const CMD_SHOW_LIST
command constants
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAuthorPresentationPageObjectGUI()

ilAssQuestionHintPageObjectCommandForwarder::buildAuthorPresentationPageObjectGUI ( )
private

forwards the command to page object gui for author presentation

Definition at line 165 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References ilAssQuestionHintsGUI\CMD_SHOW_LIST, ILIAS\Repository\ctrl(), ensurePageObjectExists(), getPageObjectGUI(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by forward().

166  {
167  $this->tabs->setBackTarget(
168  $this->lng->txt('tst_question_hints_back_to_hint_list'),
169  $this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST)
170  );
171 
172  $this->ensurePageObjectExists(
173  $this->questionHint->getPageObjectType(),
174  $this->questionHint->getId()
175  );
176 
177  $pageObjectGUI = $this->getPageObjectGUI(
178  $this->questionHint->getPageObjectType(),
179  $this->questionHint->getId()
180  );
181  $pageObjectGUI->setTemplateTargetVar('ADM_CONTENT');
182  $pageObjectGUI->setTemplateOutput(true);
183  $pageObjectGUI->setEnabledTabs(true);
184 
185  return $pageObjectGUI;
186  }
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with giben type/id
const CMD_SHOW_LIST
command constants
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPreviewPresentationPageObjectGUI()

ilAssQuestionHintPageObjectCommandForwarder::buildPreviewPresentationPageObjectGUI ( )
private

forwards the command to page object gui for author presentation

Definition at line 114 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References ilAssQuestionHintsGUI\CMD_SHOW_LIST, ILIAS\Repository\ctrl(), ilAssQuestionHint\getHintIndexLabel(), getPageObjectGUI(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by forward().

115  {
116  $this->tabs->setBackTarget(
117  $this->lng->txt('tst_question_hints_back_to_hint_list'),
118  $this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST)
119  );
120 
121  $pageObjectGUI = $this->getPageObjectGUI(
122  $this->questionHint->getPageObjectType(),
123  $this->questionHint->getId()
124  );
125 
126  $pageObjectGUI->setEnabledTabs(false);
127 
128  $pageObjectGUI->setPresentationTitle(
129  ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
130  );
131 
132  return $pageObjectGUI;
133  }
const CMD_SHOW_LIST
command constants
static getHintIndexLabel(ilLanguage $lng, $hintIndex)
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildRequestPresentationPageObjectGUI()

ilAssQuestionHintPageObjectCommandForwarder::buildRequestPresentationPageObjectGUI ( )
private

forwards the command to page object gui for author presentation

Definition at line 138 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References ilAssQuestionHintRequestGUI\CMD_SHOW_LIST, ILIAS\Repository\ctrl(), ilAssQuestionHint\getHintIndexLabel(), getPageObjectGUI(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by forward().

139  {
140  $this->tabs->setBackTarget(
141  $this->lng->txt('tst_question_hints_back_to_hint_list'),
142  $this->ctrl->getLinkTargetByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST)
143  );
144 
145  $pageObjectGUI = $this->getPageObjectGUI(
146  $this->questionHint->getPageObjectType(),
147  $this->questionHint->getId()
148  );
149 
150  $pageObjectGUI->setEnabledTabs(false);
151  $pageObjectGUI->setEnableEditing(false);
152  $pageObjectGUI->setTemplateTargetVar('ADM_CONTENT');
153  $pageObjectGUI->setTemplateOutput(true);
154 
155  $pageObjectGUI->setPresentationTitle(
156  ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
157  );
158 
159  return $pageObjectGUI;
160  }
static getHintIndexLabel(ilLanguage $lng, $hintIndex)
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ensurePageObjectExists()

ilAssQuestionHintPageObjectCommandForwarder::ensurePageObjectExists (   $pageObjectType,
  $pageObjectId 
)
protected

ensures an existing page object with giben type/id

protected

Definition at line 236 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References ilPageObject\_exists().

Referenced by buildAuthorPresentationPageObjectGUI().

236  : void
237  {
238  if (!ilAssHintPage::_exists($pageObjectType, $pageObjectId, '', true)) {
239  $pageObject = new ilAssHintPage();
240  $pageObject->setParentId($this->questionOBJ->getId());
241  $pageObject->setId($pageObjectId);
242  $pageObject->createFromXML();
243  }
244  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forward()

ilAssQuestionHintPageObjectCommandForwarder::forward ( )

forward method

Exceptions
ilTestQuestionPoolException

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

References buildAuthorPresentationPageObjectGUI(), buildPreviewPresentationPageObjectGUI(), buildRequestPresentationPageObjectGUI(), ILIAS\Repository\ctrl(), and getPresentationMode().

87  : void
88  {
89  switch ($this->getPresentationMode()) {
90  case self::PRESENTATION_MODE_AUTHOR:
91 
92  $pageObjectGUI = $this->buildAuthorPresentationPageObjectGUI();
93  break;
94 
95  case self::PRESENTATION_MODE_PREVIEW:
96 
97  $pageObjectGUI = $this->buildPreviewPresentationPageObjectGUI();
98  break;
99 
100  case self::PRESENTATION_MODE_REQUEST:
101 
102  $pageObjectGUI = $this->buildRequestPresentationPageObjectGUI();
103  break;
104  }
105 
106  $this->ctrl->setParameter($pageObjectGUI, 'hint_id', $this->questionHint->getId());
107 
108  $this->ctrl->forwardCommand($pageObjectGUI);
109  }
buildPreviewPresentationPageObjectGUI()
forwards the command to page object gui for author presentation
buildAuthorPresentationPageObjectGUI()
forwards the command to page object gui for author presentation
buildRequestPresentationPageObjectGUI()
forwards the command to page object gui for author presentation
+ Here is the call graph for this function:

◆ getPageObjectGUI()

ilAssQuestionHintPageObjectCommandForwarder::getPageObjectGUI (   $pageObjectType,
  $pageObjectId 
)
protected

instantiates, initialises and returns a page object gui object

Definition at line 221 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

Referenced by buildAuthorPresentationPageObjectGUI(), buildPreviewPresentationPageObjectGUI(), and buildRequestPresentationPageObjectGUI().

222  {
223  $pageObjectGUI = new ilAssHintPageGUI($pageObjectId);
224  $pageObjectGUI->obj->addUpdateListener(
225  $this->questionOBJ,
226  'updateTimestamp'
227  );
228  return $pageObjectGUI;
229  }
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:

◆ getPresentationMode()

ilAssQuestionHintPageObjectCommandForwarder::getPresentationMode ( )

getter for presentation mode

Returns
string

Definition at line 193 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References $presentationMode.

Referenced by forward().

+ Here is the caller graph for this function:

◆ setPresentationMode()

ilAssQuestionHintPageObjectCommandForwarder::setPresentationMode (   $presentationMode)

setter for presentation mode

Parameters
string$presentationMode
Exceptions
ilTestQuestionPoolException

Definition at line 204 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

References $presentationMode.

204  : void
205  {
206  switch ($presentationMode) {
207  case self::PRESENTATION_MODE_AUTHOR:
208  case self::PRESENTATION_MODE_PREVIEW:
209  case self::PRESENTATION_MODE_REQUEST:
210 
211  $this->presentationMode = $presentationMode;
212  break;
213 
214  default: throw new ilTestQuestionPoolException('invalid presentation mode given: ' . $presentationMode);
215  }
216  }

Field Documentation

◆ $presentationMode

ilAssQuestionHintPageObjectCommandForwarder::$presentationMode
protected

◆ $questionHint

ilAssQuestionHintPageObjectCommandForwarder::$questionHint
protected

◆ PRESENTATION_MODE_AUTHOR

const ilAssQuestionHintPageObjectCommandForwarder::PRESENTATION_MODE_AUTHOR = 'PRESENTATION_MODE_AUTHOR'

◆ PRESENTATION_MODE_PREVIEW

const ilAssQuestionHintPageObjectCommandForwarder::PRESENTATION_MODE_PREVIEW = 'PRESENTATION_MODE_PREVIEW'

presentation mode for authoring

Definition at line 37 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

Referenced by ilAssQuestionHintsGUI\executeCommand().

◆ PRESENTATION_MODE_REQUEST

const ilAssQuestionHintPageObjectCommandForwarder::PRESENTATION_MODE_REQUEST = 'PRESENTATION_MODE_REQUEST'

presentation mode for requesting

Definition at line 42 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

Referenced by ilAssQuestionHintRequestGUI\executeCommand().


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