ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 = null
 
 $questionHint = null
 
- Protected Attributes inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 $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 56 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

57 {
58 parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
59
60 $this->questionHint = new ilAssQuestionHint();
61
62 if( !isset($_GET['hint_id']) || !(int)$_GET['hint_id'] || !$this->questionHint->load((int)$_GET['hint_id']) )
63 {
64 ilUtil::sendFailure('invalid hint id given: '.(int)$_GET['hint_id'], true);
65 $this->ctrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
66 }
67 }
$_GET["client_id"]
const CMD_SHOW_LIST
command constants
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, ilAssQuestionAbstractPageObjectCommandForwarder\$ctrl, ilAssQuestionAbstractPageObjectCommandForwarder\$lng, ilAssQuestionAbstractPageObjectCommandForwarder\$questionOBJ, ilAssQuestionAbstractPageObjectCommandForwarder\$tabs, ilAssQuestionHintsGUI\CMD_SHOW_LIST, and ilUtil\sendFailure().

+ 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

@access private

Returns
page object gui object

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

158 {
159 $this->tabs->setBackTarget(
160 $this->lng->txt('tst_question_hints_back_to_hint_list'),
161 $this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST)
162 );
163
165 $this->questionHint->getPageObjectType(), $this->questionHint->getId()
166 );
167
168 $pageObjectGUI = $this->getPageObjectGUI(
169 $this->questionHint->getPageObjectType(), $this->questionHint->getId()
170 );
171
172 $pageObjectGUI->setEnabledTabs(true);
173
174 return $pageObjectGUI;
175 }
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(), and getPageObjectGUI().

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

@access private

Returns
page object gui object

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

106 {
107 $this->tabs->setBackTarget(
108 $this->lng->txt('tst_question_hints_back_to_hint_list'),
109 $this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST)
110 );
111
112 $pageObjectGUI = $this->getPageObjectGUI(
113 $this->questionHint->getPageObjectType(), $this->questionHint->getId()
114 );
115
116 $pageObjectGUI->setEnabledTabs(false);
117
118 $pageObjectGUI->setPresentationTitle(
119 ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
120 );
121
122 return $pageObjectGUI;
123 }
static getHintIndexLabel(ilLanguage $lng, $hintIndex)

References ilAssQuestionHintsGUI\CMD_SHOW_LIST, ilAssQuestionHint\getHintIndexLabel(), and getPageObjectGUI().

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

@access private

Returns
page object gui object

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

132 {
133 $this->tabs->setBackTarget(
134 $this->lng->txt('tst_question_hints_back_to_hint_list'),
135 $this->ctrl->getLinkTargetByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST)
136 );
137
138 $pageObjectGUI = $this->getPageObjectGUI(
139 $this->questionHint->getPageObjectType(), $this->questionHint->getId()
140 );
141
142 $pageObjectGUI->setEnabledTabs(false);
143
144 $pageObjectGUI->setPresentationTitle(
145 ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
146 );
147
148 return $pageObjectGUI;
149 }

References ilAssQuestionHintRequestGUI\CMD_SHOW_LIST, ilAssQuestionHint\getHintIndexLabel(), and getPageObjectGUI().

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

231 {
232 include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPage.php");
233 if( !ilAssHintPage::_exists($pageObjectType, $pageObjectId) )
234 {
235 $pageObject = new ilAssHintPage();
236 $pageObject->setParentId($this->questionOBJ->getId());
237 $pageObject->setId($pageObjectId);
238 $pageObject->createFromXML();
239 }
240 }
Assessment hint page object.
static _exists($a_parent_type, $a_id, $a_lang="", $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 74 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

75 {
76 switch( $this->getPresentationMode() )
77 {
79
80 $pageObjectGUI = $this->buildAuthorPresentationPageObjectGUI();
81 break;
82
84
85 $pageObjectGUI = $this->buildPreviewPresentationPageObjectGUI();
86 break;
87
89
90 $pageObjectGUI = $this->buildRequestPresentationPageObjectGUI();
91 break;
92 }
93
94 $this->ctrl->setParameter($pageObjectGUI, 'hint_id', $this->questionHint->getId());
95
96 $this->ctrl->forwardCommand($pageObjectGUI);
97 }
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(), 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

@access protected

Returns
page object gui object

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

215 {
216 include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPageGUI.php");
217 $pageObjectGUI = new ilAssHintPageGUI($pageObjectId);
218 $pageObjectGUI->obj->addUpdateListener(
219 $this->questionOBJ,
220 'updateTimestamp'
221 );
222 return $pageObjectGUI;
223 }
Assessment hint page GUI class.

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 182 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 193 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

194 {
195 switch( $presentationMode )
196 {
200
201 $this->presentationMode = $presentationMode;
202 break;
203
204 default: throw new ilTestQuestionPoolException('invalid presentation mode given: '.$presentationMode);
205 }
206 }

References $presentationMode, PRESENTATION_MODE_AUTHOR, PRESENTATION_MODE_PREVIEW, and PRESENTATION_MODE_REQUEST.

Field Documentation

◆ $presentationMode

ilAssQuestionHintPageObjectCommandForwarder::$presentationMode = null
protected

◆ $questionHint

ilAssQuestionHintPageObjectCommandForwarder::$questionHint = null
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 25 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 30 of file class.ilAssQuestionHintPageObjectCommandForwarder.php.

Referenced by ilAssQuestionHintRequestGUI\executeCommand(), forward(), and setPresentationMode().


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