ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAssQuestionFeedbackEditingGUI Class Reference
+ Collaboration diagram for ilAssQuestionFeedbackEditingGUI:

Public Member Functions

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

Data Fields

const CMD_SHOW = 'show'
 command constants
const CMD_SAVE = 'save'
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

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

Detailed Description

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

Constructor & Destructor Documentation

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

Constructor.

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.

{
$this->questionGUI = $questionGUI;
$this->questionOBJ = $questionGUI->object;
$this->feedbackOBJ = $questionGUI->object->feedbackOBJ;
$this->ctrl = $ctrl;
$this->access = $access;
$this->tpl = $tpl;
$this->tabs = $tabs;
$this->lng = $lng;
}

Member Function Documentation

ilAssQuestionFeedbackEditingGUI::buildForm ( )
private

builds the feedback editing form object

private

Returns

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

References isFormSaveable().

Referenced by saveCmd(), and showCmd().

{
require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('feedback_generic'));
$form->setTableWidth("100%");
$form->setId("feedback");
$this->feedbackOBJ->completeGenericFormProperties($form);
$this->feedbackOBJ->completeSpecificFormProperties($form);
if( $this->isFormSaveable() )
{
$form->addCommandButton(self::CMD_SAVE, $this->lng->txt("save"));
}
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionFeedbackEditingGUI::executeCommand ( )

Execute Command.

public

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

References $_GET, and $cmd.

{
$cmd = $this->ctrl->getCmd(self::CMD_SHOW);
$nextClass = $this->ctrl->getNextClass($this);
$this->ctrl->setParameter($this, 'q_id', (int)$_GET['q_id']);
switch($nextClass)
{
case 'ilassspecfeedbackpagegui':
case 'ilassgenfeedbackpagegui':
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackPageObjectCommandForwarder.php';
$forwarder = new ilAssQuestionFeedbackPageObjectCommandForwarder($this->questionOBJ, $this->ctrl, $this->tabs, $this->lng);
$forwarder->forward();
break;
default:
$cmd .= 'Cmd';
$this->$cmd();
break;
}
}
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 228 of file class.ilAssQuestionFeedbackEditingGUI.php.

References $_GET.

Referenced by buildForm().

{
$isAdditionalContentEditingModePageObject = $this->questionOBJ->isAdditionalContentEditingModePageObject();
$isSaveableInPageObjectEditingMode = $this->feedbackOBJ->isSaveableInPageObjectEditingMode();
if( $isAdditionalContentEditingModePageObject && !$isSaveableInPageObjectEditingMode )
{
return false;
}
$hasWriteAccess = $this->access->checkAccess("write", "", $_GET['ref_id']);
$isSelfAssessmentEditingMode = $this->questionOBJ->getSelfAssessmentEditingMode();
return $hasWriteAccess || $isSelfAssessmentEditingMode;
}

+ Here is the caller graph for this function:

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

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

Referenced by saveCmd().

{
global $ilUser;
if( !$_GET["calling_test"] )
{
return false;
}
if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
{
return false;
}
if( !$this->questionOBJ->_questionExistsInPool($this->questionOBJ->original_id) )
{
return false;
}
if( !assQuestion::_isWriteable($this->questionOBJ->original_id, $ilUser->getId()) )
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionFeedbackEditingGUI::saveCmd ( )
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 165 of file class.ilAssQuestionFeedbackEditingGUI.php.

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

{
$form = $this->buildForm();
$form->setValuesByPost();
if( $form->checkInput() )
{
$this->feedbackOBJ->saveGenericFormProperties($form);
$this->feedbackOBJ->saveSpecificFormProperties($form);
$this->questionOBJ->cleanupMediaObjectUsage();
if( $this->isSyncAfterSaveRequired() )
{
ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
$this->ctrl->redirect($this, self::CMD_SHOW_SYNC);
}
ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
$this->ctrl->redirect($this, self::CMD_SHOW);
}
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

ilAssQuestionFeedbackEditingGUI::showCmd ( )
private

command for rendering the feedback editing form to the content area

private

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

References buildForm().

{
$form = $this->buildForm();
$this->feedbackOBJ->initGenericFormProperties($form);
$this->feedbackOBJ->initSpecificFormProperties($form);
$this->tpl->setContent( $this->ctrl->getHTML($form) );
}

+ Here is the call graph for this function:

ilAssQuestionFeedbackEditingGUI::showSyncCmd ( )

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

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

Field Documentation

ilAssQuestionFeedbackEditingGUI::$access = null
protected

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

Referenced by __construct().

ilAssQuestionFeedbackEditingGUI::$ctrl = null
protected

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

Referenced by __construct().

ilAssQuestionFeedbackEditingGUI::$feedbackOBJ = null
protected

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

ilAssQuestionFeedbackEditingGUI::$lng = null
protected

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

Referenced by __construct().

ilAssQuestionFeedbackEditingGUI::$questionGUI = null
protected

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

Referenced by __construct().

ilAssQuestionFeedbackEditingGUI::$questionOBJ = null
protected

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

ilAssQuestionFeedbackEditingGUI::$tabs = null
protected

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

Referenced by __construct().

ilAssQuestionFeedbackEditingGUI::$tpl = null
protected

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

Referenced by __construct().

const ilAssQuestionFeedbackEditingGUI::CMD_SAVE = 'save'

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

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: