ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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.
 forward ()
 forward method
 getPresentationMode ()
 getter for presentation mode
 setPresentationMode ($presentationMode)
 setter for presentation mode

Data Fields

const PRESENTATION_MODE_AUTHOR = 'PRESENTATION_MODE_AUTHOR'
 presentation mode for authoring
const PRESENTATION_MODE_REQUEST = 'PRESENTATION_MODE_REQUEST'
 presentation mode for requesting

Protected Member Functions

 getPageObjectGUI ($pageObjectType, $pageObjectId)
 instantiates, initialises and returns a page object gui object
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with giben type/id

Protected Attributes

 $presentationMode = null
 $questionHint = null
- Protected Attributes inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 $questionOBJ = null
 $ctrl = null
 $tabs = null
 $lng = null

Private Member Functions

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

Detailed Description

Constructor & Destructor Documentation

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

Constructor.

public

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

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

References $_GET, ilAssQuestionHintsGUI\CMD_SHOW_LIST, and ilUtil\sendFailure().

{
parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
$this->questionHint = new ilAssQuestionHint();
if( !isset($_GET['hint_id']) || !(int)$_GET['hint_id'] || !$this->questionHint->load((int)$_GET['hint_id']) )
{
ilUtil::sendFailure('invalid hint id given: '.(int)$_GET['hint_id'], true);
$this->ctrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilAssQuestionHintPageObjectCommandForwarder::buildAuthorPresentationPageObjectGUI ( )
private

forwards the command to page object gui for author presentation

private

Returns
page object gui object

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

References ilAssQuestionHintsGUI\CMD_SHOW_LIST, ensurePageObjectExists(), and getPageObjectGUI().

Referenced by forward().

{
$this->tabs->setBackTarget(
$this->lng->txt('tst_question_hints_back_to_hint_list'),
$this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST)
);
$this->questionHint->getPageObjectType(), $this->questionHint->getId()
);
$pageObjectGUI = $this->getPageObjectGUI(
$this->questionHint->getPageObjectType(), $this->questionHint->getId()
);
$pageObjectGUI->setEnabledTabs(true);
return $pageObjectGUI;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionHintPageObjectCommandForwarder::buildRequestPresentationPageObjectGUI ( )
private

forwards the command to page object gui for author presentation

private

Returns
page object gui object

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

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

Referenced by forward().

{
$this->tabs->setBackTarget(
$this->lng->txt('tst_question_hints_back_to_hint_list'),
$this->ctrl->getLinkTargetByClass('ilAssQuestionHintRequestGUI', ilAssQuestionHintRequestGUI::CMD_SHOW_LIST)
);
$pageObjectGUI = $this->getPageObjectGUI(
$this->questionHint->getPageObjectType(), $this->questionHint->getId()
);
$pageObjectGUI->setEnabledTabs(false);
$pageObjectGUI->setPresentationTitle(
ilAssQuestionHint::getHintIndexLabel($this->lng, $this->questionHint->getIndex())
);
return $pageObjectGUI;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

ensures an existing page object with giben type/id

protected

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

References ilPageObject\_exists().

Referenced by buildAuthorPresentationPageObjectGUI().

{
include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPage.php");
if( !ilAssHintPage::_exists($pageObjectType, $pageObjectId) )
{
$pageObject = new ilAssHintPage();
$pageObject->setParentId($this->questionOBJ->getId());
$pageObject->setId($pageObjectId);
$pageObject->createFromXML();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionHintPageObjectCommandForwarder::forward ( )

forward method

Exceptions
ilTestQuestionPoolException

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

References buildAuthorPresentationPageObjectGUI(), buildRequestPresentationPageObjectGUI(), and getPresentationMode().

{
switch( $this->getPresentationMode() )
{
case self::PRESENTATION_MODE_AUTHOR:
$pageObjectGUI = $this->buildAuthorPresentationPageObjectGUI();
break;
case self::PRESENTATION_MODE_REQUEST:
$pageObjectGUI = $this->buildRequestPresentationPageObjectGUI();
break;
}
$this->ctrl->setParameter($pageObjectGUI, 'hint_id', $this->questionHint->getId());
$this->ctrl->forwardCommand($pageObjectGUI);
}

+ Here is the call graph for this function:

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

instantiates, initialises and returns a page object gui object

protected

Returns
page object gui object

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

Referenced by buildAuthorPresentationPageObjectGUI(), and buildRequestPresentationPageObjectGUI().

{
include_once("./Modules/TestQuestionPool/classes/class.ilAssHintPageGUI.php");
$pageObjectGUI = new ilAssHintPageGUI($pageObjectId);
return $pageObjectGUI;
}

+ Here is the caller graph for this function:

ilAssQuestionHintPageObjectCommandForwarder::getPresentationMode ( )

getter for presentation mode

Returns
string

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

References $presentationMode.

Referenced by forward().

+ Here is the caller graph for this function:

ilAssQuestionHintPageObjectCommandForwarder::setPresentationMode (   $presentationMode)

setter for presentation mode

Parameters
string$presentationMode
Exceptions
ilTestQuestionPoolException

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

References $presentationMode.

{
{
case self::PRESENTATION_MODE_AUTHOR:
case self::PRESENTATION_MODE_REQUEST:
$this->presentationMode = $presentationMode;
break;
default: throw new ilTestQuestionPoolException('invalid presentation mode given: '.$presentationMode);
}
}

Field Documentation

ilAssQuestionHintPageObjectCommandForwarder::$presentationMode = null
protected
ilAssQuestionHintPageObjectCommandForwarder::$questionHint = null
protected
const ilAssQuestionHintPageObjectCommandForwarder::PRESENTATION_MODE_AUTHOR = 'PRESENTATION_MODE_AUTHOR'
const ilAssQuestionHintPageObjectCommandForwarder::PRESENTATION_MODE_REQUEST = 'PRESENTATION_MODE_REQUEST'

presentation mode for requesting

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

Referenced by ilAssQuestionHintRequestGUI\executeCommand().


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