ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssQuestionFeedbackEditingGUI Class Reference
+ Collaboration diagram for ilAssQuestionFeedbackEditingGUI:

Public Member Functions

 __construct (protected readonly assQuestionGUI $question_gui, protected readonly ilCtrl $ctrl, protected readonly ilAccessHandler $access, protected readonly ilGlobalTemplateInterface $tpl, protected readonly ilTabsGUI $tabs, protected readonly ilLanguage $lng, protected readonly ilHelpGUI $help, private readonly RequestDataCollector $request, private readonly ContentStyle $content_style, private readonly bool $in_pool_context=false)
 
 executeCommand ()
 
 confirmSyncCmd ()
 
 syncCmd ()
 

Data Fields

const CMD_SHOW = 'showFeedbackForm'
 
const CMD_SAVE = 'saveFeedbackForm'
 
const CMD_SHOW_SYNC = 'confirmSync'
 
const CMD_SYNC = 'sync'
 

Protected Member Functions

 setContentStyle ()
 

Protected Attributes

assQuestion $question_obj = null
 
ilAssQuestionFeedback $feedback_obj = null
 

Private Member Functions

 showFeedbackFormCmd (string $additional_content='')
 
 saveFeedbackFormCmd ()
 
 createFeedbackPageCmd ()
 
 buildForm ()
 
 isFormSaveable ()
 
 isSyncAfterSaveRequired ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedbackEditingGUI::__construct ( protected readonly assQuestionGUI  $question_gui,
protected readonly ilCtrl  $ctrl,
protected readonly ilAccessHandler  $access,
protected readonly ilGlobalTemplateInterface  $tpl,
protected readonly ilTabsGUI  $tabs,
protected readonly ilLanguage  $lng,
protected readonly ilHelpGUI  $help,
private readonly RequestDataCollector  $request,
private readonly ContentStyle  $content_style,
private readonly bool  $in_pool_context = false 
)

Definition at line 40 of file class.ilAssQuestionFeedbackEditingGUI.php.

51  {
52  $this->question_obj = $question_gui->getObject();
53  $this->feedback_obj = $question_gui->getObject()->feedbackOBJ;
54  }

Member Function Documentation

◆ buildForm()

ilAssQuestionFeedbackEditingGUI::buildForm ( )
private

Definition at line 133 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl(), isFormSaveable(), and ILIAS\Repository\lng().

Referenced by saveFeedbackFormCmd(), and showFeedbackFormCmd().

134  {
135  $form = new ilPropertyFormGUI();
136  $form->setFormAction($this->ctrl->getFormAction($this));
137  $form->setTitle($this->lng->txt('feedback_generic'));
138  $form->setTableWidth("100%");
139  $form->setId("feedback");
140 
141  $this->feedback_obj->completeGenericFormProperties($form);
142  if ($this->question_obj->hasSpecificFeedback()) {
143  $this->feedback_obj->completeSpecificFormProperties($form);
144  }
145 
146  if ($this->isFormSaveable()) {
147  $form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
148  }
149 
150  return $form;
151  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmSyncCmd()

ilAssQuestionFeedbackEditingGUI::confirmSyncCmd ( )

Definition at line 179 of file class.ilAssQuestionFeedbackEditingGUI.php.

References showFeedbackFormCmd().

179  : void
180  {
181  $modal = $this->question_gui->getQuestionSyncModal(self::CMD_SYNC, self::class);
182  $this->showFeedbackFormCmd($modal);
183  }
+ Here is the call graph for this function:

◆ createFeedbackPageCmd()

ilAssQuestionFeedbackEditingGUI::createFeedbackPageCmd ( )
private

Definition at line 125 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl().

125  : void
126  {
127  $mode = $this->request->raw('fb_mode');
128  $this->ctrl->redirectToUrl(
129  $this->feedback_obj->createFeedbackPages($mode)
130  );
131  }
+ Here is the call graph for this function:

◆ executeCommand()

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Definition at line 56 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), setContentStyle(), and ILIAS\Repository\tabs().

56  : void
57  {
58  $this->help->setScreenIdComponent('qpl');
59 
60  $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
61  $nextClass = $this->ctrl->getNextClass($this);
62 
63  $this->ctrl->setParameter($this, 'q_id', $this->question_gui->getObject()->getId());
64 
65  $this->setContentStyle();
66 
67  switch ($nextClass) {
68  case 'ilassspecfeedbackpagegui':
69  case 'ilassgenfeedbackpagegui':
70  $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->question_obj, $this->ctrl, $this->tabs, $this->lng);
71  $forwarder->forward();
72  break;
73 
74  default:
75  $this->tabs->setTabActive('feedback');
76  $cmd .= 'Cmd';
77  $this->$cmd();
78  break;
79  }
80  }
+ Here is the call graph for this function:

◆ isFormSaveable()

ilAssQuestionFeedbackEditingGUI::isFormSaveable ( )
private

Definition at line 153 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by buildForm().

153  : bool
154  {
155  if ($this->question_obj->isAdditionalContentEditingModePageObject()
156  && !($this->feedback_obj->isSaveableInPageObjectEditingMode())) {
157  return false;
158  }
159  return true;
160  }
+ Here is the caller graph for this function:

◆ isSyncAfterSaveRequired()

ilAssQuestionFeedbackEditingGUI::isSyncAfterSaveRequired ( )
private

Definition at line 162 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by saveFeedbackFormCmd().

162  : bool
163  {
164  if ($this->in_pool_context) {
165  return false;
166  }
167 
168  if ($this->question_obj->isAdditionalContentEditingModePageObject()) {
169  return false;
170  }
171 
172  if (!$this->question_gui->needsSyncQuery()) {
173  return false;
174  }
175 
176  return true;
177  }
+ Here is the caller graph for this function:

◆ saveFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::saveFeedbackFormCmd ( )
private

Definition at line 99 of file class.ilAssQuestionFeedbackEditingGUI.php.

References buildForm(), ILIAS\Repository\ctrl(), isSyncAfterSaveRequired(), and ILIAS\Repository\lng().

99  : void
100  {
101  $form = $this->buildForm();
102  $form->setValuesByPost();
103 
104  if ($form->checkInput()) {
105  $this->feedback_obj->saveGenericFormProperties($form);
106  if ($this->question_obj->hasSpecificFeedback()) {
107  $this->feedback_obj->saveSpecificFormProperties($form);
108  }
109  $this->question_obj->cleanupMediaObjectUsage();
110  $this->question_obj->updateTimestamp();
111 
112  if ($this->isSyncAfterSaveRequired()) {
113  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
114  $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
115  }
116 
117  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
118  $this->ctrl->redirect($this, self::CMD_SHOW);
119  }
120 
121  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
122  $this->tpl->setContent($this->ctrl->getHTML($form));
123  }
+ Here is the call graph for this function:

◆ setContentStyle()

ilAssQuestionFeedbackEditingGUI::setContentStyle ( )
protected

Definition at line 82 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by executeCommand().

82  : void
83  {
84  $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId());
85  }
+ Here is the caller graph for this function:

◆ showFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::showFeedbackFormCmd ( string  $additional_content = '')
private

Definition at line 87 of file class.ilAssQuestionFeedbackEditingGUI.php.

References buildForm().

Referenced by confirmSyncCmd(), and syncCmd().

87  : void
88  {
89  $form = $this->buildForm();
90 
91  $this->feedback_obj->initGenericFormProperties($form);
92  if ($this->question_obj->hasSpecificFeedback()) {
93  $this->feedback_obj->initSpecificFormProperties($form);
94  }
95 
96  $this->tpl->setContent($form->getHTML() . $additional_content);
97  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ syncCmd()

ilAssQuestionFeedbackEditingGUI::syncCmd ( )

Definition at line 185 of file class.ilAssQuestionFeedbackEditingGUI.php.

References showFeedbackFormCmd().

185  : void
186  {
187  $this->question_obj->syncWithOriginal();
188  $this->showFeedbackFormCmd();
189  }
+ Here is the call graph for this function:

Field Documentation

◆ $feedback_obj

ilAssQuestionFeedback ilAssQuestionFeedbackEditingGUI::$feedback_obj = null
protected

Definition at line 38 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ $question_obj

assQuestion ilAssQuestionFeedbackEditingGUI::$question_obj = null
protected

Definition at line 37 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SAVE

const ilAssQuestionFeedbackEditingGUI::CMD_SAVE = 'saveFeedbackForm'

Definition at line 33 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SHOW

◆ CMD_SHOW_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SHOW_SYNC = 'confirmSync'

Definition at line 34 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ CMD_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SYNC = 'sync'

Definition at line 35 of file class.ilAssQuestionFeedbackEditingGUI.php.


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