ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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 198 of file class.ilAssQuestionFeedbackEditingGUI.php.

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

References 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 $cmd = $this->ctrl->getCmd(self::CMD_SHOW);
120 $nextClass = $this->ctrl->getNextClass($this);
121
122 $this->ctrl->setParameter($this, 'q_id', (int)$_GET['q_id']);
123
124 switch($nextClass)
125 {
126 case 'ilassspecfeedbackpagegui':
127 case 'ilassgenfeedbackpagegui':
128 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
129 $forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
130 $forwarder->forward();
131 break;
132
133 default:
134
135 $cmd .= 'Cmd';
136 $this->$cmd();
137 break;
138 }
139 }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35

References $_GET, and $cmd.

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

229 {
230 $isAdditionalContentEditingModePageObject = $this->questionOBJ->isAdditionalContentEditingModePageObject();
231 $isSaveableInPageObjectEditingMode = $this->feedbackOBJ->isSaveableInPageObjectEditingMode();
232
233 if( $isAdditionalContentEditingModePageObject && !$isSaveableInPageObjectEditingMode )
234 {
235 return false;
236 }
237
238 $hasWriteAccess = $this->access->checkAccess("write", "", $_GET['ref_id']);
239 $isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode();
240
241 return $hasWriteAccess || $isSelfAssessmentEditingMode;
242 }

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

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

References $_GET, $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 165 of file class.ilAssQuestionFeedbackEditingGUI.php.

166 {
167 $form = $this->buildForm();
168
169 $form->setValuesByPost();
170
171 if( $form->checkInput() )
172 {
173 $this->feedbackOBJ->saveGenericFormProperties($form);
174 $this->feedbackOBJ->saveSpecificFormProperties($form);
175
176 $this->questionOBJ->cleanupMediaObjectUsage();
177
178 if( $this->isSyncAfterSaveRequired() )
179 {
180 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
181 $this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
182 }
183
184 ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
185 $this->ctrl->redirect($this, self::CMD_SHOW);
186 }
187
188 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
189 $this->tpl->setContent( $this->ctrl->getHTML($form) );
190 }
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References buildForm(), isSyncAfterSaveRequired(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

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

147 {
148 $form = $this->buildForm();
149
150 $this->feedbackOBJ->initGenericFormProperties($form);
151 $this->feedbackOBJ->initSpecificFormProperties($form);
152
153 $this->tpl->setContent( $this->ctrl->getHTML($form) );
154 }

References buildForm().

+ Here is the call graph for this function:

◆ showSyncCmd()

ilAssQuestionFeedbackEditingGUI::showSyncCmd ( )

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

279 {
280 $this->questionGUI->originalSyncForm('','true');
281 }

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: