ILIAS  release_8 Revision v8.24
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
ILIAS TestQuestionPool InternalRequestService $request
 
 $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 38 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

39 {
40 global $DIC;
41 $main_tpl = $DIC->ui()->mainTemplate();
43
44 if (!$this->request->isset('feedback_id') || !(int) $this->request->raw('feedback_id') || !$questionOBJ->feedbackOBJ->checkFeedbackParent((int) $this->request->raw('feedback_id'))) {
45 $main_tpl->setOnScreenMessage('failure', 'invalid feedback id given: ' . (int) $this->request->raw('feedback_id'), true);
46 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
47 }
48
49 if (!$this->request->isset('feedback_type') || !ilAssQuestionFeedback::isValidFeedbackPageObjectType($this->request->raw('feedback_type'))) {
50 $main_tpl->setOnScreenMessage('failure', 'invalid feedback type given: ' . $this->request->raw('feedback_type'), true);
51 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
52 }
53 }
static isValidFeedbackPageObjectType(string $feedbackPageObjectType)
returns the fact whether the given page object type relates to generic or specific feedback page obje...
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(), ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ILIAS\Repository\ctrl(), and ilAssQuestionFeedback\isValidFeedbackPageObjectType().

+ 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 79 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

79 : void
80 {
82 && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
83 $pageObject = new ilAssGenFeedbackPage();
84 $pageObject->setParentId($this->questionOBJ->getId());
85 $pageObject->setId($pageObjectId);
86 $pageObject->createFromXML();
87 }
89 && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
90 $pageObject = new ilAssSpecFeedbackPage();
91 $pageObject->setParentId($this->questionOBJ->getId());
92 $pageObject->setId($pageObjectId);
93 $pageObject->createFromXML();
94 }
95 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
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(), 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 58 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

58 : void
59 {
60 $pageObjectGUI = $this->getPageObjectGUI($this->request->raw('feedback_type'), $this->request->raw('feedback_id'));
61 $pageObjectGUI->setEnabledTabs(true);
62
63 $this->tabs->setBackTarget(
64 $this->lng->txt('tst_question_feedback_back_to_feedback_form'),
65 $this->ctrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW)
66 );
67
68 $this->ctrl->setParameter($pageObjectGUI, 'feedback_id', $this->request->raw('feedback_id'));
69 $this->ctrl->setParameter($pageObjectGUI, 'feedback_type', $this->request->raw('feedback_type'));
70
71 $this->ctrl->forwardCommand($pageObjectGUI);
72 }
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui class

References ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ILIAS\Repository\ctrl(), getPageObjectGUI(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ 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 103 of file class.ilAssQuestionFeedbackPageObjectCommandForwarder.php.

104 {
105 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
107 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php");
108 $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
109 $pageObjectGUI->obj->addUpdateListener(
110 $this->questionOBJ,
111 'updateTimestamp'
112 );
113 return $pageObjectGUI;
114 }
115 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php");
116 $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
117 $pageObjectGUI->obj->addUpdateListener(
118 $this->questionOBJ,
119 'updateTimestamp'
120 );
121 return $pageObjectGUI;
122 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilAssQuestionFeedback\PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

Referenced by forward().

+ Here is the caller graph for this function:

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