ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssQuestionFeedbackEditingGUI Class Reference
+ Collaboration diagram for ilAssQuestionFeedbackEditingGUI:

Public Member Functions

 __construct (assQuestionGUI $questionGUI, ilCtrl $ctrl, ilAccessHandler $access, ilTemplate $tpl, ilTabsGUI $tabs, ilLanguage $lng)
 Constructor. More...
 
 executeCommand ()
 Execute Command. More...
 
 showSyncCmd ()
 

Data Fields

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

Protected Attributes

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

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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedbackEditingGUI::__construct ( assQuestionGUI  $questionGUI,
ilCtrl  $ctrl,
ilAccessHandler  $access,
ilTemplate  $tpl,
ilTabsGUI  $tabs,
ilLanguage  $lng 
)

Constructor.

@access public

Parameters
assQuestionGUI$questionGUI
ilCtrl$ctrl
ilAccessHandler$access
ilTemplate$tpl
ilTabsGUI$tabs
ilLanguage$lng

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

References $access, $ctrl, $lng, $questionGUI, $tabs, and $tpl.

Member Function Documentation

◆ buildForm()

ilAssQuestionFeedbackEditingGUI::buildForm ( )
private

builds the feedback editing form object

@access private

Returns
\ilPropertyFormGUI

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

206 {
207 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
208
209 $form = new ilPropertyFormGUI();
210 $form->setFormAction($this->ctrl->getFormAction($this));
211 $form->setTitle($this->lng->txt('feedback_generic'));
212 $form->setTableWidth("100%");
213 $form->setId("feedback");
214
215 $this->feedbackOBJ->completeGenericFormProperties($form);
216 $this->feedbackOBJ->completeSpecificFormProperties($form);
217
218 if ($this->isFormSaveable()) {
219 $form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
220 }
221
222 return $form;
223 }
isFormSaveable()
returns the fact wether the feedback editing form has to be saveable or not.
This class represents a property form user interface.
if(isset($_POST['submit'])) $form

References $form, and isFormSaveable().

Referenced by saveFeedbackFormCmd(), and showFeedbackFormCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Execute Command.

@access public

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

118 {
119 global $DIC; /* @var \ILIAS\DI\Container $DIC */
120 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
121 $ilHelp->setScreenIdComponent('qpl');
122
123 $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
124 $nextClass = $this->ctrl->getNextClass($this);
125
126 $this->ctrl->setParameter($this, 'q_id', (int) $_GET['q_id']);
127
128 switch ($nextClass) {
129 case 'ilassspecfeedbackpagegui':
130 case 'ilassgenfeedbackpagegui':
131 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
132 $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
133 $forwarder->forward();
134 break;
135
136 default:
137
138 $cmd .= 'Cmd';
139 $this->$cmd();
140 break;
141 }
142 }
$_GET["client_id"]
global $DIC
Definition: saml.php:7

References $_GET, and $DIC.

◆ 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

@access private

Returns
boolean $isFormSaveable

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

235 {
236 $isAdditionalContentEditingModePageObject = $this->questionOBJ->isAdditionalContentEditingModePageObject();
237 $isSaveableInPageObjectEditingMode = $this->feedbackOBJ->isSaveableInPageObjectEditingMode();
238
239 if ($isAdditionalContentEditingModePageObject && !$isSaveableInPageObjectEditingMode) {
240 return false;
241 }
242
243 $hasWriteAccess = $this->access->checkAccess("write", "", $_GET['ref_id']);
244 $isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode();
245
246 return $hasWriteAccess || $isSelfAssessmentEditingMode;
247 }

References $_GET.

Referenced by buildForm().

+ 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

@access private

Returns
boolean $isSyncAfterSaveRequired

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

257 {
258 global $DIC;
259 $ilUser = $DIC['ilUser'];
260
261 if (!$_GET["calling_test"]) {
262 return false;
263 }
264
265 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
266 return false;
267 }
268
269 if (!$this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id)) {
270 return false;
271 }
272
273 if (!assQuestion::_isWriteable($this->questionOBJ->original_id, $ilUser->getId())) {
274 return false;
275 }
276
277 return true;
278 }
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
$ilUser
Definition: imgupload.php:18

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

Referenced by saveFeedbackFormCmd().

+ 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

@access private

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

174 {
175 $form = $this->buildForm();
176
177 $form->setValuesByPost();
178
179 if ($form->checkInput()) {
180 $this->feedbackOBJ->saveGenericFormProperties($form);
181 $this->feedbackOBJ->saveSpecificFormProperties($form);
182
183 $this->questionOBJ->cleanupMediaObjectUsage();
184 $this->questionOBJ->updateTimestamp();
185
186 if ($this->isSyncAfterSaveRequired()) {
187 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
188 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
189 }
190
191 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
192 $this->ctrl->redirect($this, self::CMD_SHOW);
193 }
194
195 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
196 $this->tpl->setContent($this->ctrl->getHTML($form));
197 }
isSyncAfterSaveRequired()
returns the fact wether the presentation of the question sync2pool form is required after saving the ...
buildForm()
builds the feedback editing form object
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $form, buildForm(), isSyncAfterSaveRequired(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ showFeedbackFormCmd()

ilAssQuestionFeedbackEditingGUI::showFeedbackFormCmd ( )
private

command for rendering the feedback editing form to the content area

@access private

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

150 {
151 require_once "./Services/Style/Content/classes/class.ilObjStyleSheet.php";
152 $this->tpl->setCurrentBlock("ContentStyle");
153 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
154 $this->tpl->parseCurrentBlock();
155
156 $form = $this->buildForm();
157
158 $this->feedbackOBJ->initGenericFormProperties($form);
159 $this->feedbackOBJ->initSpecificFormProperties($form);
160
161 $this->tpl->setContent($this->ctrl->getHTML($form));
162 }
static getContentStylePath($a_style_id, $add_random=true)
get content style path

References $form, buildForm(), and ilObjStyleSheet\getContentStylePath().

+ Here is the call graph for this function:

◆ showSyncCmd()

ilAssQuestionFeedbackEditingGUI::showSyncCmd ( )

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

281 {
282 $this->questionGUI->originalSyncForm('', 'true');
283 }

Field Documentation

◆ $access

ilAssQuestionFeedbackEditingGUI::$access = null
protected

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

Referenced by __construct().

◆ $ctrl

ilAssQuestionFeedbackEditingGUI::$ctrl = null
protected

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

Referenced by __construct().

◆ $feedbackOBJ

ilAssQuestionFeedbackEditingGUI::$feedbackOBJ = null
protected

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

◆ $lng

ilAssQuestionFeedbackEditingGUI::$lng = null
protected

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

Referenced by __construct().

◆ $questionGUI

ilAssQuestionFeedbackEditingGUI::$questionGUI = null
protected

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

Referenced by __construct().

◆ $questionOBJ

ilAssQuestionFeedbackEditingGUI::$questionOBJ = null
protected

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

◆ $tabs

ilAssQuestionFeedbackEditingGUI::$tabs = null
protected

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

Referenced by __construct().

◆ $tpl

ilAssQuestionFeedbackEditingGUI::$tpl = null
protected

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

Referenced by __construct().

◆ CMD_SAVE

const ilAssQuestionFeedbackEditingGUI::CMD_SAVE = 'saveFeedbackForm'

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

◆ CMD_SHOW

◆ CMD_SHOW_SYNC

const ilAssQuestionFeedbackEditingGUI::CMD_SHOW_SYNC = 'showSync'

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


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