ILIAS  release_8 Revision v8.24
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...
 
 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, 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...
 
 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
ILIAS TestQuestionPool InternalRequestService $request
 
 $questionOBJ = null
 
 $ctrl = null
 
 $tabs = null
 
 $lng = null
 

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.

@access public

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

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

69 {
70 global $DIC;
71 $main_tpl = $DIC->ui()->mainTemplate();
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: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilAssQuestionAbstractPageObjectCommandForwarder\$ctrl, $DIC, ilAssQuestionAbstractPageObjectCommandForwarder\$lng, ilAssQuestionAbstractPageObjectCommandForwarder\$questionOBJ, ilAssQuestionAbstractPageObjectCommandForwarder\$tabs, ILIAS\GlobalScreen\Provider\__construct(), ilAssQuestionHintsGUI\CMD_SHOW_LIST, and ILIAS\Repository\ctrl().

+ 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 163 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

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

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

Referenced by forward().

+ 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.

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 }
static getHintIndexLabel(ilLanguage $lng, $hintIndex)

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

Referenced by forward().

+ 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.

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
153 $pageObjectGUI->setPresentationTitle(
154 ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
155 );
156
157 return $pageObjectGUI;
158 }

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

Referenced by forward().

+ 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

@access protected

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

234 : void
235 {
236 include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPage.php");
237 if (!ilAssHintPage::_exists($pageObjectType, $pageObjectId, '', true)) {
238 $pageObject = new ilAssHintPage();
239 $pageObject->setParentId($this->questionOBJ->getId());
240 $pageObject->setId($pageObjectId);
241 $pageObject->createFromXML();
242 }
243 }
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.

References ilPageObject\_exists().

Referenced by buildAuthorPresentationPageObjectGUI().

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

◆ forward()

ilAssQuestionHintPageObjectCommandForwarder::forward ( )

forward method

Exceptions
ilTestQuestionPoolException

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

87 : void
88 {
89 switch ($this->getPresentationMode()) {
91
92 $pageObjectGUI = $this->buildAuthorPresentationPageObjectGUI();
93 break;
94
96
97 $pageObjectGUI = $this->buildPreviewPresentationPageObjectGUI();
98 break;
99
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 }
buildRequestPresentationPageObjectGUI()
forwards the command to page object gui for author presentation
buildPreviewPresentationPageObjectGUI()
forwards the command to page object gui for author presentation
buildAuthorPresentationPageObjectGUI()
forwards the command to page object gui for author presentation

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

+ Here is the call graph for this function:

◆ getPageObjectGUI()

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

instantiates, initialises and returns a page object gui object

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

219 {
220 include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPageGUI.php");
221 $pageObjectGUI = new ilAssHintPageGUI($pageObjectId);
222 $pageObjectGUI->obj->addUpdateListener(
223 $this->questionOBJ,
224 'updateTimestamp'
225 );
226 return $pageObjectGUI;
227 }

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

+ Here is the caller graph for this function:

◆ getPresentationMode()

ilAssQuestionHintPageObjectCommandForwarder::getPresentationMode ( )

getter for presentation mode

Returns
string

Definition at line 190 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 201 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

201 : void
202 {
203 switch ($presentationMode) {
207
208 $this->presentationMode = $presentationMode;
209 break;
210
211 default: throw new ilTestQuestionPoolException('invalid presentation mode given: ' . $presentationMode);
212 }
213 }

References $presentationMode, PRESENTATION_MODE_AUTHOR, PRESENTATION_MODE_PREVIEW, and PRESENTATION_MODE_REQUEST.

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(), forward(), and setPresentationMode().

◆ 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(), forward(), and setPresentationMode().


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