ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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
 

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 239 of file class.ilAssQuestionFeedbackEditingGUI.php.

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

Referenced by saveFeedbackFormCmd(), and showFeedbackFormCmd().

240  {
241  $form = new ilPropertyFormGUI();
242  $form->setFormAction($this->ctrl->getFormAction($this));
243  $form->setTitle($this->lng->txt('feedback_generic'));
244  $form->setTableWidth("100%");
245  $form->setId("feedback");
246 
247  $this->feedbackOBJ->completeGenericFormProperties($form);
248  if ($this->questionOBJ->hasSpecificFeedback()) {
249  $this->feedbackOBJ->completeSpecificFormProperties($form);
250  }
251 
252  if ($this->isFormSaveable()) {
253  $form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
254  }
255 
256  return $form;
257  }
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:

◆ executeCommand()

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Execute Command.

public

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

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

140  : void
141  {
142  global $DIC; /* @var \ILIAS\DI\Container $DIC */
143  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
144  $ilHelp->setScreenIdComponent('qpl');
145 
146  $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
147  $nextClass = $this->ctrl->getNextClass($this);
148 
149  $this->ctrl->setParameter($this, 'q_id', $this->request->getQuestionId());
150 
151  $this->setContentStyle();
152 
153  switch ($nextClass) {
154  case 'ilassspecfeedbackpagegui':
155  case 'ilassgenfeedbackpagegui':
156  $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
157  $forwarder->forward();
158  break;
159 
160  default:
161  if ($this->questionOBJ->selfassessmenteditingmode) {
162  $this->tabs->setTabActive('feedback');
163  } else {
164  $this->tabs->setTabActive('tst_feedback');
165  }
166  $cmd .= 'Cmd';
167  $this->$cmd();
168  break;
169  }
170  }
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 268 of file class.ilAssQuestionFeedbackEditingGUI.php.

References ILIAS\Repository\access().

Referenced by buildForm().

268  : bool
269  {
270  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()
271  && !($this->feedbackOBJ->isSaveableInPageObjectEditingMode())) {
272  return false;
273  }
274 
275  $hasWriteAccess = $this->access->checkAccess("write", "", $this->request->getRefId());
276  $isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode();
277 
278  return $hasWriteAccess || $isSelfAssessmentEditingMode;
279  }
+ 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 288 of file class.ilAssQuestionFeedbackEditingGUI.php.

References $DIC, $ilUser, and assQuestion\_isWriteable().

Referenced by saveFeedbackFormCmd().

288  : bool
289  {
290  global $DIC;
291  $ilUser = $DIC['ilUser'];
292 
293  if (!$this->request->isset("calling_test")) {
294  return false;
295  }
296 
297  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
298  return false;
299  }
300 
301  if (!$this->questionOBJ->_questionExistsInPool((int) $this->questionOBJ->getOriginalId())) {
302  return false;
303  }
304 
305  if (!$this->questionOBJ->_questionExistsInPool((int) $this->questionOBJ->getOriginalId())) {
306  return false;
307  }
308 
309  if (!assQuestion::_isWriteable($this->questionOBJ->getOriginalId(), $ilUser->getId())) {
310  return false;
311  }
312 
313  return true;
314  }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
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 206 of file class.ilAssQuestionFeedbackEditingGUI.php.

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

206  : void
207  {
208  $form = $this->buildForm();
209 
210  $form->setValuesByPost();
211 
212  if ($form->checkInput()) {
213  $this->feedbackOBJ->saveGenericFormProperties($form);
214  if ($this->questionOBJ->hasSpecificFeedback()) {
215  $this->feedbackOBJ->saveSpecificFormProperties($form);
216  }
217  $this->questionOBJ->cleanupMediaObjectUsage();
218  $this->questionOBJ->updateTimestamp();
219 
220  if ($this->isSyncAfterSaveRequired()) {
221  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
222  $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
223  }
224 
225  $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
226  $this->ctrl->redirect($this, self::CMD_SHOW);
227  }
228 
229  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('form_input_not_valid'));
230  $this->tpl->setContent($this->ctrl->getHTML($form));
231  }
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 175 of file class.ilAssQuestionFeedbackEditingGUI.php.

Referenced by executeCommand().

175  : void
176  {
177  $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId());
178  }
+ 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 185 of file class.ilAssQuestionFeedbackEditingGUI.php.

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

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

◆ showSyncCmd()

ilAssQuestionFeedbackEditingGUI::showSyncCmd ( )

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

316  : void
317  {
318  $this->questionGUI->originalSyncForm('', 'true');
319  }

Field Documentation

◆ $access

ilAssQuestionFeedbackEditingGUI::$access = null
protected

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

◆ $content_style

ContentStyle ilAssQuestionFeedbackEditingGUI::$content_style
protected

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

◆ $ctrl

ilAssQuestionFeedbackEditingGUI::$ctrl = null
protected

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

◆ $feedbackOBJ

ilAssQuestionFeedbackEditingGUI::$feedbackOBJ = null
protected

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

◆ $lng

ilAssQuestionFeedbackEditingGUI::$lng = null
protected

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

◆ $questionGUI

ilAssQuestionFeedbackEditingGUI::$questionGUI = null
protected

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

◆ $questionOBJ

ilAssQuestionFeedbackEditingGUI::$questionOBJ = null
protected

Definition at line 56 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 96 of file class.ilAssQuestionFeedbackEditingGUI.php.

◆ $tpl

ilAssQuestionFeedbackEditingGUI::$tpl = null
protected

Definition at line 88 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: