ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
- Public Member Functions inherited from ilAssQuestionAbstractPageObjectCommandForwarder
 __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

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

public

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

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

References $_GET, ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ilAssQuestionFeedback\isValidFeedbackPageObjectType(), and ilUtil\sendFailure().

26  {
27  parent::__construct($questionOBJ, $ctrl, $tabs, $lng);
28 
29  if (!isset($_GET['feedback_id']) || !(int) $_GET['feedback_id'] || !$questionOBJ->feedbackOBJ->checkFeedbackParent((int) $_GET['feedback_id'])) {
30  ilUtil::sendFailure('invalid feedback id given: ' . (int) $_GET['feedback_id'], true);
31  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
32  }
33 
34  if (!isset($_GET['feedback_type']) || !ilAssQuestionFeedback::isValidFeedbackPageObjectType($_GET['feedback_type'])) {
35  ilUtil::sendFailure('invalid feedback type given: ' . $_GET['feedback_type'], true);
36  $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
37  }
38  }
$_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.
+ 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

protected

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

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

67  {
68  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
70  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
71  if (!ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
72  $pageObject = new ilAssGenFeedbackPage();
73  $pageObject->setParentId($this->questionOBJ->getId());
74  $pageObject->setId($pageObjectId);
75  $pageObject->createFromXML();
76  }
77  }
79  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
80  if (!ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
81  $pageObject = new ilAssSpecFeedbackPage();
82  $pageObject->setParentId($this->questionOBJ->getId());
83  $pageObject->setId($pageObjectId);
84  $pageObject->createFromXML();
85  }
86  }
87  }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
Generic feedback page object.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
Specific feedback page object.
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ Here is the call graph for this function:

◆ forward()

ilAssQuestionFeedbackPageObjectCommandForwarder::forward ( )

forward method

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

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

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

◆ getPageObjectGUI()

ilAssQuestionFeedbackPageObjectCommandForwarder::getPageObjectGUI (   $pageObjectType,
  $pageObjectId 
)

instantiates, initialises and returns a page object gui class

protected

Returns
ilAssGenFeedbackPageGUI|ilAssSpecFeedbackPageGUI

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

References ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and ilAssQuestionFeedback\PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by forward().

96  {
97  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
99  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php");
100  $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
101  $pageObjectGUI->obj->addUpdateListener(
102  $this->questionOBJ,
103  'updateTimestamp'
104  );
105  return $pageObjectGUI;
106  }
108  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php");
109  $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
110  $pageObjectGUI->obj->addUpdateListener(
111  $this->questionOBJ,
112  'updateTimestamp'
113  );
114  return $pageObjectGUI;
115  }
116  }
Generic feedback page GUI class.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
Specific feedback page GUI class.
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ Here is the caller graph for this function:

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