ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAssQuestionFeedbackPageObjectCommandForwarder.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionAbstractPageObjectCommandForwarder.php';
5 
15 {
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  }
39 
43  public function forward()
44  {
45  $pageObjectGUI = $this->getPageObjectGUI($_GET['feedback_type'], $_GET['feedback_id']);
46 
47  $pageObjectGUI->setEnabledTabs(true);
48 
49  $this->tabs->setBackTarget(
50  $this->lng->txt('tst_question_feedback_back_to_feedback_form'),
51  $this->ctrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW)
52  );
53 
54  $this->ctrl->setParameter($pageObjectGUI, 'feedback_id', $_GET['feedback_id']);
55  $this->ctrl->setParameter($pageObjectGUI, 'feedback_type', $_GET['feedback_type']);
56 
57  $this->ctrl->forwardCommand($pageObjectGUI);
58  }
59 
65  public function ensurePageObjectExists($pageObjectType, $pageObjectId)
66  {
68  && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
69  $pageObject = new ilAssGenFeedbackPage();
70  $pageObject->setParentId($this->questionOBJ->getId());
71  $pageObject->setId($pageObjectId);
72  $pageObject->createFromXML();
73  }
75  && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
76  $pageObject = new ilAssSpecFeedbackPage();
77  $pageObject->setParentId($this->questionOBJ->getId());
78  $pageObject->setId($pageObjectId);
79  $pageObject->createFromXML();
80  }
81  }
82 
89  public function getPageObjectGUI($pageObjectType, $pageObjectId)
90  {
91  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
93  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php");
94  $pageObjectGUI = new ilAssGenFeedbackPageGUI($pageObjectId);
95  $pageObjectGUI->obj->addUpdateListener(
96  $this->questionOBJ,
97  'updateTimestamp'
98  );
99  return $pageObjectGUI;
100  }
102  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php");
103  $pageObjectGUI = new ilAssSpecFeedbackPageGUI($pageObjectId);
104  $pageObjectGUI->obj->addUpdateListener(
105  $this->questionOBJ,
106  'updateTimestamp'
107  );
108  return $pageObjectGUI;
109  }
110  }
111 }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
Constructor.
This class provides processing control methods.
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui class
Tabs GUI.
Generic feedback page GUI class.
$_GET["client_id"]
Abstract basic class which is to be extended by the concrete assessment question type classes...
static isValidFeedbackPageObjectType($feedbackPageObjectType)
returns the fact wether the given page object type relates to generic or specific feedback page objec...
Generic feedback page object.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Specific feedback page object.
Specific feedback page GUI class.
__construct(Container $dic, ilPlugin $plugin)
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with giben type/id
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects