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

Public Member Functions

 completeSpecificFormProperties (ilPropertyFormGUI $form)
 completes a given form object with the specific form properties required by this question type
 initSpecificFormProperties (ilPropertyFormGUI $form)
 initialises a given form object's specific form properties relating to this question type
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 saves a given form object's specific form properties relating to this question type
 isSaveableInPageObjectEditingMode ()
 returns the fact that the feedback editing form is saveable in page object editing mode, because this question type has additional feedback settings
 saveSpecificFeedbackSetting ($questionId, $specificFeedbackSetting)
 saves the given specific feedback setting for the given question id to the db.
- Public Member Functions inherited from ilAssMultiOptionQuestionFeedback
 getSpecificAnswerFeedbackTestPresentation ($questionId, $answerIndex)
 returns the html of SPECIFIC feedback for the given question id and answer index for test presentation
 getSpecificAnswerFeedbackContent ($questionId, $answerIndex)
 returns the SPECIFIC answer feedback content for a given question id and answer index.
 saveSpecificAnswerFeedbackContent ($questionId, $answerIndex, $feedbackContent)
 saves SPECIFIC answer feedback content for the given question id and answer index to the database.
 deleteSpecificAnswerFeedbacks ($questionId, $isAdditionalContentEditingModePageObject)
 deletes all SPECIFIC answer feedback contents (and page objects if required) for the given question id
 getSpecificAnswerFeedbackExportPresentation ($questionId, $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted
 importSpecificAnswerFeedback ($questionId, $answerIndex, $feedbackContent)
 imports the given feedback content as specific feedback for the given question id and answer index
 specificAnswerFeedbackExists ($answerIndexes)
- Public Member Functions inherited from ilAssQuestionFeedback
 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilDB $db, ilLanguage $lng)
 constructor
 getGenericFeedbackTestPresentation ($questionId, $solutionCompleted)
 returns the html of GENERIC feedback for the given question id for test presentation (either for the complete solution or for the incomplete solution)
 completeGenericFormProperties (ilPropertyFormGUI $form)
 completes a given form object with the GENERIC form properties required by all question types
 initGenericFormProperties (ilPropertyFormGUI $form)
 initialises a given form object's GENERIC form properties relating to all question types
 saveGenericFormProperties (ilPropertyFormGUI $form)
 saves a given form object's GENERIC form properties relating to all question types
 getGenericFeedbackContent ($questionId, $solutionCompleted)
 returns the GENERIC feedback content for a given question state.
 saveGenericFeedbackContent ($questionId, $solutionCompleted, $feedbackContent)
 saves GENERIC feedback content for the given question id to the database.
 deleteGenericFeedbacks ($questionId, $isAdditionalContentEditingModePageObject)
 deletes all GENERIC feedback contents (and page objects if required) for the given question id
 duplicateFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the feedback relating to the given original question id and saves it for the given duplicate question id
 syncFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the feedback from a duplicated question back to the original question
 getClassNameByType ($a_type, $a_gui=false)
 Get class name by type.
 setPageObjectOutputMode ($a_val)
 Set page object output mode.
 getPageObjectOutputMode ()
 Get page object output mode.
 getGenericFeedbackExportPresentation ($questionId, $solutionCompleted)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted
 importGenericFeedback ($questionId, $solutionCompleted, $feedbackContent)
 imports the given feedback content as generic feedback for the given question id for either the complete or incomplete solution

Protected Member Functions

 duplicateSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question
- Protected Member Functions inherited from ilAssMultiOptionQuestionFeedback
 getSpecificAnswerFeedbackId ($questionId, $answerIndex)
 returns the SPECIFIC answer feedback ID for a given question id and answer index.
 getSpecificAnswerFeedbackIdByAnswerIndexMap ($questionId)
 returns an array mapping feedback ids to answer indexes for all answer options of question
 getSpecificFeedbackTableName ()
 returns the table name for specific feedback
 getAnswerOptionsByAnswerIndex ()
 returns the answer options mapped by answer index (can be overwritten by concrete question type class)
 buildAnswerOptionLabel ($index, $answer)
 builds an answer option label from given (mixed type) index and answer (can be overwritten by concrete question types)
 getSpecificAnswerFeedbackPageObjectId ($questionId, $answerIndex)
 returns a useable page object id for specific answer feedback page objects for the given question id and answer index (using the id sequence of non page object specific answer feedback)
- Protected Member Functions inherited from ilAssQuestionFeedback
 buildFeedbackContentFormProperty ($label, $postVar, $asNonEditable)
 builds and returns a form property gui object with the given label and postvar that is addable to property forms depending on the given flag "asNonEditable" it returns a ...
 getGenericFeedbackId ($questionId, $solutionCompleted)
 returns the SPECIFIC answer feedback ID for a given question id and answer index.
 getGenericFeedbackTableName ()
 returns the table name for specific feedback
 getPageObjectNonEditableValueHTML ($pageObjectType, $pageObjectId)
 returns html content to be used as value for non editable value form properties in feedback editing form
 getPageObjectContent ($pageObjectType, $pageObjectId)
 returns the content of page object with given type and id
 getPageObjectXML ($pageObjectType, $pageObjectId)
 returns the xml of page object with given type and id
 createPageObject ($pageObjectType, $pageObjectId, $pageObjectContent)
 creates a new page object with given page object id and page object type and passed page object content
 duplicatePageObject ($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
 duplicates the page object with given type and original id to new page object with same type and given duplicate id and duplicate parent id
 ensurePageObjectDeleted ($pageObjectType, $pageObjectId)
 ensures a no more existing page object for given type and id
 getGenericFeedbackPageObjectType ()
 returns the type for generic feedback page objects defined in local constant
 getSpecificAnswerFeedbackPageObjectType ()
 returns the type for specific feedback page objects defined in local constant
 getGenericFeedbackPageObjectId ($questionId, $solutionCompleted)
 returns a useable page object id for generic feedback page objects for the given question id for either the complete or incomplete solution (using the id sequence of non page object generic feedback)

Private Member Functions

 syncSpecificFeedbackSetting ($sourceQuestionId, $targetQuestionId)

Additional Inherited Members

- Static Public Member Functions inherited from ilAssQuestionFeedback
static isValidFeedbackPageObjectType ($feedbackPageObjectType)
 returns the fact wether the given page object type relates to generic or specific feedback page objects
- Data Fields inherited from ilAssMultiOptionQuestionFeedback
const TABLE_NAME_SPECIFIC_FEEDBACK = 'qpl_fb_specific'
 table name for specific feedback
- Protected Attributes inherited from ilAssQuestionFeedback
 $questionOBJ = null
 $ctrl = null
 $db = null
 $lng = null
 $page_obj_output_mode = "presentation"

Detailed Description

Member Function Documentation

ilAssConfigurableMultiOptionQuestionFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)

completes a given form object with the specific form properties required by this question type

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 29 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

References ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), ilAssMultiOptionQuestionFeedback\buildAnswerOptionLabel(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), and ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex().

{
if( !$this->questionOBJ->getSelfAssessmentEditingMode() )
{
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt('feedback_answers'));
$form->addItem($header);
require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
require_once './Services/Form/classes/class.ilRadioOption.php';
$feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_all'), 1), true);
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_checked'), 2));
$feedback->addOption(new ilRadioOption($this->lng->txt('feedback_correct'), 3));
$form->addItem($feedback);
foreach( $this->getAnswerOptionsByAnswerIndex() as $index => $answer )
{
$propertyLabel = $this->questionOBJ->prepareTextareaOutput(
$this->buildAnswerOptionLabel($index, $answer), true
);
$propertyPostVar = "feedback_answer_$index";
$propertyLabel , $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()
));
}
}
}

+ Here is the call graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::duplicateSpecificFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
protected

duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id

(overwrites the method from parent class, because of individual setting)

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 160 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

References $res, $row, ilAssQuestionFeedback\duplicatePageObject(), ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType(), ilAssMultiOptionQuestionFeedback\getSpecificFeedbackTableName(), and syncSpecificFeedbackSetting().

{
// sync specific feedback setting to duplicated question
$this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
// sync specific answer feedback to duplicated question
$res = $this->db->queryF(
"SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($originalQuestionId)
);
while( $row = $this->db->fetchAssoc($res) )
{
$nextId = $this->db->nextId($this->getSpecificFeedbackTableName());
$this->db->insert($this->getSpecificFeedbackTableName(), array(
'feedback_id' => array('integer', $nextId),
'question_fi' => array('integer', $duplicateQuestionId),
'answer' => array('integer', $row['answer']),
'feedback' => array('text', $row['feedback']),
'tstamp' => array('integer', time())
));
if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
{
$pageObjectType = $this->getSpecificAnswerFeedbackPageObjectType();
$this->duplicatePageObject($pageObjectType, $row['feedback_id'], $nextId, $duplicateQuestionId);
}
}
}

+ Here is the call graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)

initialises a given form object's specific form properties relating to this question type

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

Reimplemented from ilAssMultiOptionQuestionFeedback.

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

References ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getItemByPostVar(), ilAssQuestionFeedback\getPageObjectNonEditableValueHTML(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackContent(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackPageObjectId(), and ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType().

{
if (!$this->questionOBJ->getSelfAssessmentEditingMode())
{
$form->getItemByPostVar('feedback_setting')->setValue(
$this->questionOBJ->getSpecificFeedbackSetting()
);
foreach( $this->getAnswerOptionsByAnswerIndex() as $index => $answer )
{
if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
{
$this->getSpecificAnswerFeedbackPageObjectId($this->questionOBJ->getId(), $index)
);
}
else
{
$value = $this->questionOBJ->prepareTextareaOutput(
$this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $index)
);
}
$form->getItemByPostVar("feedback_answer_$index")->setValue($value);
}
}
}

+ Here is the call graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::isSaveableInPageObjectEditingMode ( )

returns the fact that the feedback editing form is saveable in page object editing mode, because this question type has additional feedback settings

public

Returns
boolean

Reimplemented from ilAssQuestionFeedback.

Definition at line 130 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

{
return true;
}
ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFeedbackSetting (   $questionId,
  $specificFeedbackSetting 
)

saves the given specific feedback setting for the given question id to the db.

(It::s stored to dataset of question itself) public

Parameters
integer$questionId
integer$specificFeedbackSetting

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

Referenced by saveSpecificFormProperties().

{
$this->db->update($this->getSpecificQuestionTableName(),
array('feedback_setting' => array('integer', $specificFeedbackSetting)),
array('question_fi' => array('integer', $questionId))
);
}

+ Here is the caller graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)

saves a given form object's specific form properties relating to this question type

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 108 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

References ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getInput(), ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent(), and saveSpecificFeedbackSetting().

{
if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
{
$this->saveSpecificFeedbackSetting($this->questionOBJ->getId(), $form->getInput('feedback_setting'));
foreach( $this->getAnswerOptionsByAnswerIndex() as $index => $answer )
{
$this->questionOBJ->getId(), $index, $form->getInput("feedback_answer_$index")
);
}
}
}

+ Here is the call graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::syncSpecificFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
protected

syncs the SPECIFIC feedback from a duplicated question back to the original question

(overwrites the method from parent class, because of individual setting)

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 201 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

References $res, $row, ilAssMultiOptionQuestionFeedback\getSpecificFeedbackTableName(), and syncSpecificFeedbackSetting().

{
// sync specific feedback setting to the original
$this->syncSpecificFeedbackSetting($duplicateQuestionId, $originalQuestionId);
// delete specific feedback of the original
$this->db->manipulateF(
"DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
array('integer'), array($originalQuestionId)
);
// get specific feedback of the actual question
$res = $this->db->queryF(
"SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
array('integer'), array($duplicateQuestionId)
);
// save specific feedback to the original
while( $row = $this->db->fetchAssoc($res) )
{
$nextId = $this->db->nextId($this->getSpecificFeedbackTableName());
$this->db->insert($this->getSpecificFeedbackTableName(), array(
'feedback_id' => array('integer', $nextId),
'question_fi' => array('integer', $originalQuestionId),
'answer' => array('integer',$row['answer']),
'feedback' => array('text',$row['feedback']),
'tstamp' => array('integer',time())
));
}
}

+ Here is the call graph for this function:

ilAssConfigurableMultiOptionQuestionFeedback::syncSpecificFeedbackSetting (   $sourceQuestionId,
  $targetQuestionId 
)
private

Definition at line 233 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

References $res, and $row.

Referenced by duplicateSpecificFeedback(), and syncSpecificFeedback().

{
$res = $this->db->queryF(
"SELECT feedback_setting FROM {$this->getSpecificQuestionTableName()} WHERE question_fi = %s",
array('integer'), array($sourceQuestionId)
);
$row = $this->db->fetchAssoc($res);
$this->db->update( $this->getSpecificQuestionTableName(),
array( 'feedback_setting' => array('integer', $row['feedback_setting']) ),
array( 'question_fi' => array('integer', $targetQuestionId) )
);
}

+ Here is the caller graph for this function:


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