ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssQuestionFeedbackPageObjectCommandForwarder Class Reference
+ Inheritance diagram for ilAssQuestionFeedbackPageObjectCommandForwarder:
+ Collaboration diagram for ilAssQuestionFeedbackPageObjectCommandForwarder:

Public Member Functions

 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
 Constructor. More...
 
 forward ()
 forward method 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 class 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...
 

Additional Inherited Members

 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 inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 $questionOBJ = null
 
 $ctrl = null
 
 $tabs = null
 
 $lng = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedbackPageObjectCommandForwarder::__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 25 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

26 {
27 parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
28
29 if( !isset($_GET['feedback_id']) || !(int)$_GET['feedback_id'] )
30 {
31 ilUtil::sendFailure('invalid feedback id given: '.(int)$_GET['feedback_id'], true);
32 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
33 }
34
35 if( !isset($_GET['feedback_type']) || !ilAssQuestionFeedback::isValidFeedbackPageObjectType($_GET['feedback_type']) )
36 {
37 ilUtil::sendFailure('invalid feedback type given: '.$_GET['feedback_type'], true);
38 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
39 }
40 }
$_GET["client_id"]
static isValidFeedbackPageObjectType($feedbackPageObjectType)
returns the fact wether the given page object type relates to generic or specific feedback page objec...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, ilAssQuestionAbstractPageObjectCommandForwarder\$ctrl, ilAssQuestionAbstractPageObjectCommandForwarder\$lng, ilAssQuestionAbstractPageObjectCommandForwarder\$questionOBJ, ilAssQuestionAbstractPageObjectCommandForwarder\$tabs, ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ilAssQuestionFeedback\isValidFeedbackPageObjectType(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

Member Function Documentation

◆ ensurePageObjectExists()

ilAssQuestionFeedbackPageObjectCommandForwarder::ensurePageObjectExists (   $pageObjectType,
  $pageObjectId 
)

ensures an existing page object with giben type/id

@access protected

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

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

69 {
70 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
72 {
73 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
74 if( !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
75 {
76 $pageObject = new ilAssGenFeedbackPage();
77 $pageObject->setParentId($this->questionOBJ->getId());
78 $pageObject->setId($pageObjectId);
79 $pageObject->createFromXML();
80 }
81 }
83 {
84 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
85 if( !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
86 {
87 $pageObject = new ilAssSpecFeedbackPage();
88 $pageObject->setParentId($this->questionOBJ->getId());
89 $pageObject->setId($pageObjectId);
90 $pageObject->createFromXML();
91 }
92 }
93 }
Generic feedback page object.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
Specific feedback page object.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.

References ilPageObject\_exists(), ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and ilAssQuestionFeedback\PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

+ Here is the call graph for this function:

◆ forward()

ilAssQuestionFeedbackPageObjectCommandForwarder::forward ( )

forward method

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

Definition at line 45 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

46 {
47 //$this->ensurePageObjectExists($_GET['feedback_type'], $_GET['feedback_id']);
48
49 $pageObjectGUI = $this->getPageObjectGUI($_GET['feedback_type'], $_GET['feedback_id']);
50 $pageObjectGUI->setEnabledTabs(true);
51
52 $this->tabs->setBackTarget(
53 $this->lng->txt('tst_question_feedback_back_to_feedback_form'),
54 $this->ctrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW)
55 );
56
57 $this->ctrl->setParameter($pageObjectGUI, 'feedback_id', $_GET['feedback_id']);
58 $this->ctrl->setParameter($pageObjectGUI, 'feedback_type', $_GET['feedback_type']);
59
60 $this->ctrl->forwardCommand($pageObjectGUI);
61 }
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui class

References $_GET, ilAssQuestionFeedbackEditingGUI\CMD_SHOW, and getPageObjectGUI().

+ Here is the call graph for this function:

◆ getPageObjectGUI()

ilAssQuestionFeedbackPageObjectCommandForwarder::getPageObjectGUI (   $pageObjectType,
  $pageObjectId 
)

instantiates, initialises and returns a page object gui class

@access protected

Returns
ilAssGenFeedbackPageGUI|ilAssSpecFeedbackPageGUI

Reimplemented from ilAssQuestionAbstractPageObjectCommandForwarder.

Definition at line 101 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

102 {
103 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
105 {
106 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php");
107 $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
108 $pageObjectGUI->obj->addUpdateListener(
109 $this->questionOBJ,
110 'updateTimestamp'
111 );
112 return $pageObjectGUI;
113 }
115 {
116 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php");
117 $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
118 $pageObjectGUI->obj->addUpdateListener(
119 $this->questionOBJ,
120 'updateTimestamp'
121 );
122 return $pageObjectGUI;
123 }
124 }
Generic feedback page GUI class.
Specific feedback page GUI class.

References ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and ilAssQuestionFeedback\PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by forward().

+ Here is the caller graph for this function:

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