ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilAssQuestionFeedbackEditingGUI Class Reference
+ Collaboration diagram for ilAssQuestionFeedbackEditingGUI:

Public Member Functions

 executeCommand ()
 Execute Command. More...
 
 showSyncCmd ()
 

Data Fields

const CMD_SHOW = 'showFeedbackForm'
 command constants More...
 
const CMD_SAVE = 'saveFeedbackForm'
 
const CMD_SHOW_SYNC = 'showSync'
 

Protected Member Functions

 setContentStyle ()
 Set content style. More...
 

Protected Attributes

 $questionGUI = null
 
 $questionOBJ = null
 
 $feedbackOBJ = null
 
 $ctrl = null
 
 $access = null
 
 $tpl = null
 
 $tabs = null
 
 $lng = null
 
ContentStyle $content_style
 

Private Member Functions

 showFeedbackFormCmd ()
 command for rendering the feedback editing form to the content area More...
 
 saveFeedbackFormCmd ()
 command for processing the submitted feedback editing form. More...
 
 createFeedbackPageCmd ()
 
 buildForm ()
 builds the feedback editing form object More...
 
 isFormSaveable ()
 returns the fact wether the feedback editing form has to be saveable or not. More...
 
 isSyncAfterSaveRequired ()
 returns the fact wether the presentation of the question sync2pool form is required after saving the form or not More...
 

Private Attributes

ILIAS TestQuestionPool InternalRequestService $request
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 

Detailed Description

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

Member Function Documentation

◆ buildForm()

ilAssQuestionFeedbackEditingGUI::buildForm ( )
private

builds the feedback editing form object

private

Returns

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

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

Referenced by saveFeedbackFormCmd(), and showFeedbackFormCmd().

246  {
247  $form = new ilPropertyFormGUI();
248  $form->setFormAction($this->ctrl->getFormAction($this));
249  $form->setTitle($this->lng->txt('feedback_generic'));
250  $form->setTableWidth("100%");
251  $form->setId("feedback");
252 
253  $this->feedbackOBJ->completeGenericFormProperties($form);
254  if ($this->questionOBJ->hasSpecificFeedback()) {
255  $this->feedbackOBJ->completeSpecificFormProperties($form);
256  }
257 
258  if ($this->isFormSaveable()) {
259  $form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
260  }
261 
262  return $form;
263  }
isFormSaveable()
returns the fact wether the feedback editing form has to be saveable or not.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createFeedbackPageCmd()

ilAssQuestionFeedbackEditingGUI::createFeedbackPageCmd ( )
private

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

References ILIAS\Repository\ctrl().

231  : void
232  {
233  $mode = $this->request->raw('fb_mode');
234  $this->ctrl->redirectToUrl(
235  $this->feedbackOBJ->createFeedbackPages($mode)
236  );
237  }
+ Here is the call graph for this function:

◆ executeCommand()

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Execute Command.

public

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

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

142  : void
143  {
144  global $DIC; /* @var \ILIAS\DI\Container $DIC */
145  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
146  $ilHelp->setScreenIdComponent('qpl');
147 
148  $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
149  $nextClass = $this->ctrl->getNextClass($this);
150 
151  $this->ctrl->setParameter($this, 'q_id', $this->request->getQuestionId());
152 
153  $this->setContentStyle();
154 
155  switch ($nextClass) {
156  case 'ilassspecfeedbackpagegui':
157  case 'ilassgenfeedbackpagegui':
158  $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
159  $forwarder->forward();
160  break;
161 
162  default:
163  $this->tabs->setTabActive('feedback');
164  $cmd .= 'Cmd';
165  $this->$cmd();
166  break;
167  }
168  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ isFormSaveable()

ilAssQuestionFeedbackEditingGUI::isFormSaveable ( )
private

returns the fact wether the feedback editing form has to be saveable or not.

this depends on the additional content editing mode and the current question type, as well as on fact wether the question is writable for current user or not, or the fact if we are in self assessment mode or not

private

Returns
boolean $isFormSaveable

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

References ILIAS\Repository\access().

Referenced by buildForm().

274  : bool
275  {
276  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()
277  && !($this->feedbackOBJ->isSaveableInPageObjectEditingMode())) {
278  return false;
279  }
280 
281  $hasWriteAccess = $this->access->checkAccess("write", "", $this->request->getRefId());
282  $isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode();
283 
284  return $hasWriteAccess || $isSelfAssessmentEditingMode;
285  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSyncAfterSaveRequired()

ilAssQuestionFeedbackEditingGUI::isSyncAfterSaveRequired ( )
private

returns the fact wether the presentation of the question sync2pool form is required after saving the form or not

private

Returns
boolean $isSyncAfterSaveRequired

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

References $DIC, and assQuestion\_isWriteable().

Referenced by saveFeedbackFormCmd().

294  : bool
295  {
296  global $DIC;
297  $ilUser = $DIC['ilUser'];
298 
299  if (!$this->request->isset("calling_test")) {
300  return false;
301  }
302 
303  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
304  return false;
305  }
306 
307  if (!$this->questioninfo->questionExistsInPool((int) $this->questionOBJ->getOriginalId())) {
308  return false;
309  }
310 
311  if (!$this->questioninfo->questionExistsInPool((int) $this->questionOBJ->getOriginalId())) {
312  return false;
313  }
314 
315  if (!assQuestion::_isWriteable($this->questionOBJ->getOriginalId(), $ilUser->getId())) {
316  return false;
317  }
318 
319  return true;
320  }
global $DIC
Definition: feed.php:28
static _isWriteable(int $question_id, int $user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::saveFeedbackFormCmd ( )
private

command for processing the submitted feedback editing form.

first it validates the submitted values.

  • in case of successfull validation it saves the properties and redirects to either form presentation again, or to the syncWithOriginal form for question
  • in case of failed validation it renders the form with post values and error info to the content area again

private

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

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

204  : void
205  {
206  $form = $this->buildForm();
207 
208  $form->setValuesByPost();
209 
210  if ($form->checkInput()) {
211  $this->feedbackOBJ->saveGenericFormProperties($form);
212  if ($this->questionOBJ->hasSpecificFeedback()) {
213  $this->feedbackOBJ->saveSpecificFormProperties($form);
214  }
215  $this->questionOBJ->cleanupMediaObjectUsage();
216  $this->questionOBJ->updateTimestamp();
217 
218  if ($this->isSyncAfterSaveRequired()) {
219  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
220  $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
221  }
222 
223  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
224  $this->ctrl->redirect($this, self::CMD_SHOW);
225  }
226 
227  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
228  $this->tpl->setContent($this->ctrl->getHTML($form));
229  }
buildForm()
builds the feedback editing form object
isSyncAfterSaveRequired()
returns the fact wether the presentation of the question sync2pool form is required after saving the ...
+ Here is the call graph for this function:

◆ setContentStyle()

ilAssQuestionFeedbackEditingGUI::setContentStyle ( )
protected

Set content style.

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

Referenced by executeCommand().

173  : void
174  {
175  $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId());
176  }
+ Here is the caller graph for this function:

◆ showFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::showFeedbackFormCmd ( )
private

command for rendering the feedback editing form to the content area

private

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

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

183  : void
184  {
185  $form = $this->buildForm();
186 
187  $this->feedbackOBJ->initGenericFormProperties($form);
188  if ($this->questionOBJ->hasSpecificFeedback()) {
189  $this->feedbackOBJ->initSpecificFormProperties($form);
190  }
191 
192  $this->tpl->setContent($this->ctrl->getHTML($form));
193  }
buildForm()
builds the feedback editing form object
+ Here is the call graph for this function:

◆ showSyncCmd()

ilAssQuestionFeedbackEditingGUI::showSyncCmd ( )

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

322  : void
323  {
324  $this->questionGUI->originalSyncForm('', 'true');
325  }

Field Documentation

◆ $access

ilAssQuestionFeedbackEditingGUI::$access = null
protected

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

◆ $content_style

ContentStyle ilAssQuestionFeedbackEditingGUI::$content_style
protected

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

◆ $ctrl

ilAssQuestionFeedbackEditingGUI::$ctrl = null
protected

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

◆ $feedbackOBJ

ilAssQuestionFeedbackEditingGUI::$feedbackOBJ = null
protected

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

◆ $lng

ilAssQuestionFeedbackEditingGUI::$lng = null
protected

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

◆ $questionGUI

ilAssQuestionFeedbackEditingGUI::$questionGUI = null
protected

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

◆ $questioninfo

ILIAS TestQuestionPool QuestionInfoService ilAssQuestionFeedbackEditingGUI::$questioninfo
private

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

◆ $questionOBJ

ilAssQuestionFeedbackEditingGUI::$questionOBJ = null
protected

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

◆ $request

ILIAS TestQuestionPool InternalRequestService ilAssQuestionFeedbackEditingGUI::$request
private

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

◆ $tabs

ilAssQuestionFeedbackEditingGUI::$tabs = null
protected

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

◆ $tpl

ilAssQuestionFeedbackEditingGUI::$tpl = null
protected

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

◆ CMD_SAVE

const ilAssQuestionFeedbackEditingGUI::CMD_SAVE = 'saveFeedbackForm'

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

◆ CMD_SHOW

◆ CMD_SHOW_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SHOW_SYNC = 'showSync'

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


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