ILIAS  release_8 Revision v8.24
class.ilAssQuestionFeedbackPageObjectCommandForwarder.php
Go to the documentation of this file.
1<?php
2
28{
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 }
54
58 public function forward(): 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 }
73
79 public function ensurePageObjectExists($pageObjectType, $pageObjectId): 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 }
96
103 public function getPageObjectGUI($pageObjectType, $pageObjectId)
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 }
123}
Abstract basic class which is to be extended by the concrete assessment question type classes.
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...
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with giben type/id
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilTabsGUI $tabs, ilLanguage $lng)
Constructor.
getPageObjectGUI($pageObjectType, $pageObjectId)
instantiates, initialises and returns a page object gui class
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
static isValidFeedbackPageObjectType(string $feedbackPageObjectType)
returns the fact whether the given page object type relates to generic or specific feedback page obje...
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...
Class ilCtrl provides processing control methods.
language handling
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc