ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssQuestionFeedback Class Reference
+ Inheritance diagram for ilAssQuestionFeedback:
+ Collaboration diagram for ilAssQuestionFeedback:

Public Member Functions

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

Static Public Member Functions

static isValidFeedbackPageObjectType ($feedbackPageObjectType)
 returns the fact wether the given page object type relates to generic or specific feedback page objects More...
 

Data Fields

const CSS_CLASS_FEEDBACK_CORRECT = 'ilc_qfeedr_FeedbackRight'
 
const CSS_CLASS_FEEDBACK_WRONG = 'ilc_qfeedw_FeedbackWrong'
 
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK = 'qfbg'
 type for generic feedback page objects More...
 
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK = 'qfbs'
 type for specific feedback page objects More...
 
const FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID = 1
 id for page object relating to generic incomplete solution feedback More...
 
const FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID = 2
 id for page object relating to generic complete solution feedback More...
 
const TABLE_NAME_GENERIC_FEEDBACK = 'qpl_fb_generic'
 table name for specific feedback More...
 

Protected Member Functions

 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 ... More...
 
 duplicateSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 getGenericFeedbackId ($questionId, $solutionCompleted)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 getGenericFeedbackTableName ()
 returns the table name for specific feedback More...
 
 getPageObjectNonEditableValueHTML ($pageObjectType, $pageObjectId)
 returns html content to be used as value for non editable value form properties in feedback editing form More...
 
 getPageObjectContent ($pageObjectType, $pageObjectId)
 returns the content of page object with given type and id More...
 
 getPageObjectXML ($pageObjectType, $pageObjectId)
 returns the xml of page object with given type and id More...
 
 createPageObject ($pageObjectType, $pageObjectId, $pageObjectContent)
 creates a new page object with given page object id and page object type and passed page object content More...
 
 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 More...
 
 ensurePageObjectDeleted ($pageObjectType, $pageObjectId)
 ensures a no more existing page object for given type and id More...
 
 getGenericFeedbackPageObjectType ()
 returns the type for generic feedback page objects defined in local constant More...
 
 getSpecificAnswerFeedbackPageObjectType ()
 returns the type for specific feedback page objects defined in local constant More...
 
 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) More...
 

Protected Attributes

 $questionOBJ = null
 
 $ctrl = null
 
 $db = null
 
 $lng = null
 
 $page_obj_output_mode = "presentation"
 

Private Member Functions

 duplicateGenericFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the GENERIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncGenericFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the GENERIC feedback from a duplicated question back to the original question More...
 
 getPageObjectEditingLink ($pageObjectType, $pageObjectId)
 returns a link to page object editor for page object with given type and id More...
 
 ensurePageObjectExists ($pageObjectType, $pageObjectId)
 ensures an existing page object with given type and id More...
 

Detailed Description

Definition at line 14 of file class.ilAssQuestionFeedback.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionFeedback::__construct ( assQuestion  $questionOBJ,
ilCtrl  $ctrl,
ilDB  $db,
ilLanguage  $lng 
)
final

constructor

@final @access public

Parameters
assQuestion$questionOBJ
ilCtrl$ctrl
ilDB$db
ilLanguage$lng

Definition at line 94 of file class.ilAssQuestionFeedback.php.

References $ctrl, $db, $lng, and $questionOBJ.

Member Function Documentation

◆ buildFeedbackContentFormProperty()

ilAssQuestionFeedback::buildFeedbackContentFormProperty (   $label,
  $postVar,
  $asNonEditable 
)
finalprotected

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

  • non editable gui
  • textarea input gui

@final @access protected

Parameters
string$label
string$postVar
boolean$asNonEditable
Returns
ilTextAreaInputGUI|ilNonEditableValueGUI $formProperty

Definition at line 273 of file class.ilAssQuestionFeedback.php.

274 {
275 if($asNonEditable)
276 {
277 require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
278
279 $property = new ilNonEditableValueGUI($label, $postVar, true);
280 }
281 else
282 {
283 require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
284 require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
285
286 $property = new ilTextAreaInputGUI($label, $postVar);
287 $property->setRequired(false);
288 $property->setRows(10);
289 $property->setCols(80);
290
291 if( !$this->questionOBJ->getPreventRteUsage() )
292 {
293 $property->setUseRte(true);
294 $property->addPlugin("latex");
295 $property->addButton("latex");
296 $property->addButton("pastelatex");
297
298 require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
299 $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
300 $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
301 }
302 else
303 {
304 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
306 $property->setUseTagsForRteOnly(false);
307 }
308
309 $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
310 }
311
312 return $property;
313 }
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This class represents a non editable value in a property form.
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
This class represents a text area property in a property form.

References ilObjAdvancedEditing\_getUsedHTMLTags(), and ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags().

Referenced by completeGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\completeSpecificFormProperties(), and ilAssMultiOptionQuestionFeedback\completeSpecificFormProperties().

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

◆ completeGenericFormProperties()

ilAssQuestionFeedback::completeGenericFormProperties ( ilPropertyFormGUI  $form)
final

completes a given form object with the GENERIC form properties required by all question types

@final @access public

Parameters
ilPropertyFormGUI$form

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

150 {
152 $this->lng->txt('feedback_complete_solution'), 'feedback_complete',
153 $this->questionOBJ->isAdditionalContentEditingModePageObject()
154 ));
155
157 $this->lng->txt('feedback_incomplete_solution'), 'feedback_incomplete',
158 $this->questionOBJ->isAdditionalContentEditingModePageObject()
159 ));
160 }
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
addItem($a_item)
Add Item (Property, SectionHeader).

References ilPropertyFormGUI\addItem(), and buildFeedbackContentFormProperty().

+ Here is the call graph for this function:

◆ completeSpecificFormProperties()

ilAssQuestionFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

@abstract @access public

Parameters
ilPropertyFormGUI$form

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ createPageObject()

ilAssQuestionFeedback::createPageObject (   $pageObjectType,
  $pageObjectId,
  $pageObjectContent 
)
finalprotected

creates a new page object with given page object id and page object type and passed page object content

@final @access protected

Parameters
string$pageObjectType
integer$pageObjectId
string$pageObjectContent

Definition at line 808 of file class.ilAssQuestionFeedback.php.

809 {
810 $cl = $this->getClassNameByType($pageObjectType);
811 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
812
813 $pageObject = new $cl();
814 $pageObject->setParentId($this->questionOBJ->getId());
815 $pageObject->setId($pageObjectId);
816 $pageObject->setXMLContent($pageObjectContent);
817 $pageObject->createFromXML();
818 }
getClassNameByType($a_type, $a_gui=false)
Get class name by type.

References getClassNameByType().

Referenced by importGenericFeedback(), and ilAssMultiOptionQuestionFeedback\importSpecificAnswerFeedback().

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

◆ deleteGenericFeedbacks()

ilAssQuestionFeedback::deleteGenericFeedbacks (   $questionId,
  $isAdditionalContentEditingModePageObject 
)
final

deletes all GENERIC feedback contents (and page objects if required) for the given question id

@final @access public

Parameters
integer$questionId
boolean$isAdditionalContentEditingModePageObject

Definition at line 444 of file class.ilAssQuestionFeedback.php.

445 {
446 if( $isAdditionalContentEditingModePageObject )
447 {
450 $this->getGenericFeedbackPageObjectId($questionId, true)
451 );
452
455 $this->getGenericFeedbackPageObjectId($questionId, false)
456 );
457 }
458
459 $this->db->manipulateF(
460 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($questionId)
461 );
462 }
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id

References ensurePageObjectDeleted(), getGenericFeedbackPageObjectId(), and getGenericFeedbackPageObjectType().

+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacks()

ilAssQuestionFeedback::deleteSpecificAnswerFeedbacks (   $questionId,
  $isAdditionalContentEditingModePageObject 
)
abstract

deletes all SPECIFIC feedback contents for the given question id

@abstract @access public

Parameters
integer$questionId
boolean$isAdditionalContentEditingModePageObject

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ duplicateFeedback()

ilAssQuestionFeedback::duplicateFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
final

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

@final @access public

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Definition at line 483 of file class.ilAssQuestionFeedback.php.

484 {
485 $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
486 $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
487 }
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...

References duplicateGenericFeedback(), and duplicateSpecificFeedback().

+ Here is the call graph for this function:

◆ duplicateGenericFeedback()

ilAssQuestionFeedback::duplicateGenericFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
finalprivate

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

@final @access private

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Definition at line 498 of file class.ilAssQuestionFeedback.php.

499 {
500 $res = $this->db->queryF(
501 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
502 array('integer'), array($originalQuestionId)
503 );
504
505 while( $row = $this->db->fetchAssoc($res) )
506 {
507 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
508
509 $this->db->insert($this->getGenericFeedbackTableName(), array(
510 'feedback_id' => array('integer', $feedbackId),
511 'question_fi' => array('integer', $duplicateQuestionId),
512 'correctness' => array('text', $row['correctness']),
513 'feedback' => array('clob', $row['feedback']),
514 'tstamp' => array('integer', time())
515 ));
516
517 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
518 {
519 $pageObjectType = $this->getGenericFeedbackPageObjectType();
520 $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
521 }
522 }
523 }
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
getGenericFeedbackTableName()
returns the table name for specific feedback

References $res, $row, duplicatePageObject(), getGenericFeedbackPageObjectType(), and getGenericFeedbackTableName().

Referenced by duplicateFeedback().

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

◆ duplicatePageObject()

ilAssQuestionFeedback::duplicatePageObject (   $pageObjectType,
  $originalPageObjectId,
  $duplicatePageObjectId,
  $duplicatePageObjectParentId 
)
finalprotected

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

@final @access protected

Parameters
string$pageObjectType
integer$originalPageObjectId
integer$duplicatePageObjectId
integer$duplicatePageObjectParentId

Definition at line 831 of file class.ilAssQuestionFeedback.php.

832 {
833 $cl = $this->getClassNameByType($pageObjectType);
834 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
835
836 $pageObject = new $cl($originalPageObjectId);
837 $pageObject->setParentId($duplicatePageObjectParentId);
838 $pageObject->setId($duplicatePageObjectId);
839 $pageObject->createFromXML();
840 }

References getClassNameByType().

Referenced by duplicateGenericFeedback(), ilAssConfigurableMultiOptionQuestionFeedback\duplicateSpecificFeedback(), and ilAssMultiOptionQuestionFeedback\duplicateSpecificFeedback().

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

◆ duplicateSpecificFeedback()

ilAssQuestionFeedback::duplicateSpecificFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
abstractprotected

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

@abstract @access protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by duplicateFeedback().

+ Here is the caller graph for this function:

◆ ensurePageObjectDeleted()

ilAssQuestionFeedback::ensurePageObjectDeleted (   $pageObjectType,
  $pageObjectId 
)
finalprotected

ensures a no more existing page object for given type and id

@final @access protected

Parameters
type$pageObjectType
type$pageObjectId

Definition at line 850 of file class.ilAssQuestionFeedback.php.

851 {
853 {
854 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
855 if( ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
856 {
857 $pageObject = new ilAssGenFeedbackPage($pageObjectId);
858 $pageObject->delete();
859 }
860 }
862 {
863 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
864 if( ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
865 {
866 $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
867 $pageObject->delete();
868 }
869 }
870 }
Generic feedback page object.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
Specific feedback page object.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.

References ilPageObject\_exists(), PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by deleteGenericFeedbacks(), and ilAssMultiOptionQuestionFeedback\deleteSpecificAnswerFeedbacks().

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

◆ ensurePageObjectExists()

ilAssQuestionFeedback::ensurePageObjectExists (   $pageObjectType,
  $pageObjectId 
)
finalprivate

ensures an existing page object with given type and id

@final @access private

Parameters
type$pageObjectType
type$pageObjectId

Definition at line 772 of file class.ilAssQuestionFeedback.php.

773 {
775 {
776 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
777 if( !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
778 {
779 $pageObject = new ilAssGenFeedbackPage();
780 $pageObject->setParentId($this->questionOBJ->getId());
781 $pageObject->setId($pageObjectId);
782 $pageObject->createFromXML();
783 }
784 }
786 {
787 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
788 if( !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
789 {
790 $pageObject = new ilAssSpecFeedbackPage();
791 $pageObject->setParentId($this->questionOBJ->getId());
792 $pageObject->setId($pageObjectId);
793 $pageObject->createFromXML();
794 }
795 }
796 }

References ilPageObject\_exists(), PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by getPageObjectContent(), and getPageObjectXML().

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

◆ getAllSpecificAnswerFeedbackContents()

ilAssQuestionFeedback::getAllSpecificAnswerFeedbackContents (   $questionId)
abstract

returns the SPECIFIC feedback content for a given question id and answer index.

@abstract @access public

Parameters
integer$questionId
Returns
string $feedbackContent

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ getClassNameByType()

ilAssQuestionFeedback::getClassNameByType (   $a_type,
  $a_gui = false 
)

Get class name by type.

Parameters

return

Definition at line 657 of file class.ilAssQuestionFeedback.php.

658 {
659 $gui = ($a_gui)
660 ? "GUI"
661 : "";
662 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
664 {
665 return "ilAssGenFeedbackPage".$gui;
666 }
668 {
669 return "ilAssSpecFeedbackPage".$gui;
670 }
671 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by createPageObject(), duplicatePageObject(), getPageObjectContent(), getPageObjectEditingLink(), and getPageObjectXML().

+ Here is the caller graph for this function:

◆ getGenericFeedbackContent()

ilAssQuestionFeedback::getGenericFeedbackContent (   $questionId,
  $solutionCompleted 
)
final

returns the GENERIC feedback content for a given question state.

the state is either the completed solution (all answers correct) of the question or at least one incorrect answer.

@final @access public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $feedbackContent

Definition at line 326 of file class.ilAssQuestionFeedback.php.

327 {
328 require_once 'Services/RTE/classes/class.ilRTE.php';
329
330 $correctness = $solutionCompleted ? 1 : 0;
331
332 $res = $this->db->queryF(
333 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
334 array('integer', 'text'), array($questionId, $correctness)
335 );
336
337 $feedbackContent = null;
338
339 while( $row = $this->db->fetchAssoc($res) )
340 {
341 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
342 break;
343 }
344
345 return $feedbackContent;
346 }
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...

References $res, $row, and ilRTE\_replaceMediaObjectImageSrc().

Referenced by getGenericFeedbackExportPresentation(), getGenericFeedbackTestPresentation(), and initGenericFormProperties().

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

◆ getGenericFeedbackExportPresentation()

ilAssQuestionFeedback::getGenericFeedbackExportPresentation (   $questionId,
  $solutionCompleted 
)

returns the generic feedback export presentation for given question id either for solution completed or incompleted

@access public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $genericFeedbackExportPresentation

Definition at line 953 of file class.ilAssQuestionFeedback.php.

954 {
955 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
956 {
957 $genericFeedbackExportPresentation = $this->getPageObjectXML(
959 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
960 );
961 }
962 else
963 {
964 $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
965 }
966
967 return $genericFeedbackExportPresentation;
968 }
getPageObjectXML($pageObjectType, $pageObjectId)
returns the xml of page object with given type and id
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.

References getGenericFeedbackContent(), getGenericFeedbackPageObjectId(), getGenericFeedbackPageObjectType(), and getPageObjectXML().

+ Here is the call graph for this function:

◆ getGenericFeedbackId()

ilAssQuestionFeedback::getGenericFeedbackId (   $questionId,
  $solutionCompleted 
)
finalprotected

returns the SPECIFIC answer feedback ID for a given question id and answer index.

@final @access protected

Parameters
integer$questionId
boolean$answerIndex
Returns
string $feedbackId

Definition at line 594 of file class.ilAssQuestionFeedback.php.

595 {
596 $res = $this->db->queryF(
597 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
598 array('integer','text'), array($questionId, (int)$solutionCompleted)
599 );
600
601 $feedbackId = null;
602
603 while( $row = $this->db->fetchAssoc($res) )
604 {
605 $feedbackId = $row['feedback_id'];
606 break;
607 }
608
609 return $feedbackId;
610 }

References $res, and $row.

Referenced by getGenericFeedbackPageObjectId(), and saveGenericFeedbackContent().

+ Here is the caller graph for this function:

◆ getGenericFeedbackPageObjectId()

ilAssQuestionFeedback::getGenericFeedbackPageObjectId (   $questionId,
  $solutionCompleted 
)
finalprotected

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)

@final @access protected

Parameters
integer$questionId
boolean$solutionCompleted
Returns
integer $pageObjectId

Definition at line 932 of file class.ilAssQuestionFeedback.php.

933 {
934 $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
935
936 if( !$pageObjectId )
937 {
938 $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
939 }
940
941 return $pageObjectId;
942 }
getGenericFeedbackId($questionId, $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index.
saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
saves GENERIC feedback content for the given question id to the database.

References getGenericFeedbackId(), and saveGenericFeedbackContent().

Referenced by deleteGenericFeedbacks(), getGenericFeedbackExportPresentation(), getGenericFeedbackTestPresentation(), importGenericFeedback(), and initGenericFormProperties().

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

◆ getGenericFeedbackPageObjectType()

ilAssQuestionFeedback::getGenericFeedbackPageObjectType ( )
finalprotected

returns the type for generic feedback page objects defined in local constant

@final @access protected

Returns
string $genericFeedbackPageObjectType

Definition at line 880 of file class.ilAssQuestionFeedback.php.

881 {
883 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

Referenced by deleteGenericFeedbacks(), duplicateGenericFeedback(), getGenericFeedbackExportPresentation(), getGenericFeedbackTestPresentation(), importGenericFeedback(), and initGenericFormProperties().

+ Here is the caller graph for this function:

◆ getGenericFeedbackTableName()

ilAssQuestionFeedback::getGenericFeedbackTableName ( )
finalprotected

returns the table name for specific feedback

@final

Returns
string $specificFeedbackTableName

Definition at line 628 of file class.ilAssQuestionFeedback.php.

629 {
631 }
const TABLE_NAME_GENERIC_FEEDBACK
table name for specific feedback

References TABLE_NAME_GENERIC_FEEDBACK.

Referenced by duplicateGenericFeedback(), saveGenericFeedbackContent(), and syncGenericFeedback().

+ Here is the caller graph for this function:

◆ getGenericFeedbackTestPresentation()

ilAssQuestionFeedback::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)

@access public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $genericFeedbackTestPresentationHTML

Definition at line 112 of file class.ilAssQuestionFeedback.php.

113 {
114 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
115 {
116 $genericFeedbackTestPresentationHTML = $this->getPageObjectContent(
118 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
119 );
120 }
121 else
122 {
123 $genericFeedbackTestPresentationHTML = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
124 }
125
126 return $genericFeedbackTestPresentationHTML;
127 }
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id

References getGenericFeedbackContent(), getGenericFeedbackPageObjectId(), getGenericFeedbackPageObjectType(), and getPageObjectContent().

+ Here is the call graph for this function:

◆ getPageObjectContent()

ilAssQuestionFeedback::getPageObjectContent (   $pageObjectType,
  $pageObjectId 
)
finalprotected

returns the content of page object with given type and id

@final @access protected

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectContent

Definition at line 725 of file class.ilAssQuestionFeedback.php.

726 {
727 global $ilCtrl;
728
729 $cl = $this->getClassNameByType($pageObjectType, true);
730 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
731
732 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
733
734 $mode = ($ilCtrl->isAsynch())
735 ? "presentation"
736 : $this->getPageObjectOutputMode();
737
738 $pageObjectGUI = new $cl($pageObjectId);
739 $pageObjectGUI->setOutputMode($mode);
740
741 return $pageObjectGUI->presentation($mode);
742 }
getPageObjectOutputMode()
Get page object output mode.
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with given type and id
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ensurePageObjectExists(), getClassNameByType(), and getPageObjectOutputMode().

Referenced by getGenericFeedbackTestPresentation(), getPageObjectNonEditableValueHTML(), and ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackTestPresentation().

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

◆ getPageObjectEditingLink()

ilAssQuestionFeedback::getPageObjectEditingLink (   $pageObjectType,
  $pageObjectId 
)
finalprivate

returns a link to page object editor for page object with given type and id

@final @access private

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectEditingLink

Definition at line 684 of file class.ilAssQuestionFeedback.php.

685 {
686 $cl = $this->getClassNameByType($pageObjectType, true);
687 $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
688 $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
689
690 $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
691 $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
692
693 return "<a href='$linkHREF'>$linkTEXT</a>";
694 }

References getClassNameByType().

Referenced by getPageObjectNonEditableValueHTML().

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

◆ getPageObjectNonEditableValueHTML()

ilAssQuestionFeedback::getPageObjectNonEditableValueHTML (   $pageObjectType,
  $pageObjectId 
)
finalprotected

returns html content to be used as value for non editable value form properties in feedback editing form

@final @access protected

Parameters
string$pageObjectType
integer$pageObjectId
Returns
string $nonEditableValueHTML

Definition at line 643 of file class.ilAssQuestionFeedback.php.

644 {
645 $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
646 $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
647
648 return "$link<br /><br />$content";
649 }
getPageObjectEditingLink($pageObjectType, $pageObjectId)
returns a link to page object editor for page object with given type and id

References getPageObjectContent(), and getPageObjectEditingLink().

Referenced by initGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\initSpecificFormProperties(), and ilAssMultiOptionQuestionFeedback\initSpecificFormProperties().

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

◆ getPageObjectOutputMode()

ilAssQuestionFeedback::getPageObjectOutputMode ( )
final

Get page object output mode.

Returns
string page output mode

Definition at line 711 of file class.ilAssQuestionFeedback.php.

References $page_obj_output_mode.

Referenced by getPageObjectContent().

+ Here is the caller graph for this function:

◆ getPageObjectXML()

ilAssQuestionFeedback::getPageObjectXML (   $pageObjectType,
  $pageObjectId 
)
finalprotected

returns the xml of page object with given type and id

@final @access protected

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectXML

Definition at line 753 of file class.ilAssQuestionFeedback.php.

754 {
755 $cl = $this->getClassNameByType($pageObjectType);
756 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
757
758 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
759
760 $pageObject = new $cl($pageObjectId);
761 return $pageObject->getXMLContent();
762 }

References ensurePageObjectExists(), and getClassNameByType().

Referenced by getGenericFeedbackExportPresentation(), and ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackExportPresentation().

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

◆ getSpecificAnswerFeedbackContent()

ilAssQuestionFeedback::getSpecificAnswerFeedbackContent (   $questionId,
  $answerIndex 
)
abstract

returns the SPECIFIC feedback content for a given question id and answer index.

@abstract @access public

Parameters
integer$questionId
integer$answerIndex
Returns
string $feedbackContent

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ getSpecificAnswerFeedbackExportPresentation()

ilAssQuestionFeedback::getSpecificAnswerFeedbackExportPresentation (   $questionId,
  $answerIndex 
)
abstract

returns the generic feedback export presentation for given question id either for solution completed or incompleted

@abstract @access public

Parameters
integer$questionId
integer$answerIndex
Returns
string $specificFeedbackExportPresentation

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ getSpecificAnswerFeedbackPageObjectType()

◆ getSpecificAnswerFeedbackTestPresentation()

ilAssQuestionFeedback::getSpecificAnswerFeedbackTestPresentation (   $questionId,
  $answerIndex 
)
abstract

returns the html of SPECIFIC feedback for the given question id and answer index for test presentation

@abstract @access public

Parameters
integer$questionId
integer$answerIndex
Returns
string $specificAnswerFeedbackTestPresentationHTML

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ importGenericFeedback()

ilAssQuestionFeedback::importGenericFeedback (   $questionId,
  $solutionCompleted,
  $feedbackContent 
)

imports the given feedback content as generic feedback for the given question id for either the complete or incomplete solution

@access public

Parameters
integer$questionId
boolean$solutionCompleted
string$feedbackContent

Definition at line 991 of file class.ilAssQuestionFeedback.php.

992 {
993 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
994 {
995 $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
996 $pageObjectType = $this->getGenericFeedbackPageObjectType();
997
998 $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
999 }
1000 else
1001 {
1002 $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
1003 }
1004 }
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...

References createPageObject(), getGenericFeedbackPageObjectId(), getGenericFeedbackPageObjectType(), and saveGenericFeedbackContent().

+ Here is the call graph for this function:

◆ importSpecificAnswerFeedback()

ilAssQuestionFeedback::importSpecificAnswerFeedback (   $questionId,
  $answerIndex,
  $feedbackContent 
)
abstract

imports the given feedback content as specific feedback for the given question id and answer index

@abstract @access public

Parameters
integer$questionId
integer$answerIndex
string$feedbackContent

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ initGenericFormProperties()

ilAssQuestionFeedback::initGenericFormProperties ( ilPropertyFormGUI  $form)
final

initialises a given form object's GENERIC form properties relating to all question types

@final @access public

Parameters
ilPropertyFormGUI$form

Definition at line 180 of file class.ilAssQuestionFeedback.php.

181 {
182 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
183 {
184 $pageObjectType = $this->getGenericFeedbackPageObjectType();
185
186 $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
187 $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
188 );
189
190 $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
191 $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
192 );
193 }
194 else
195 {
196 $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
197 $this->questionOBJ->getId(), true
198 );
199
200 $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
201 $this->questionOBJ->getId(), false
202 );
203 }
204
205 $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
206 $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
207 }
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
getItemByPostVar($a_post_var)
Get Item by POST variable.

References getGenericFeedbackContent(), getGenericFeedbackPageObjectId(), getGenericFeedbackPageObjectType(), ilPropertyFormGUI\getItemByPostVar(), and getPageObjectNonEditableValueHTML().

+ Here is the call graph for this function:

◆ initSpecificFormProperties()

ilAssQuestionFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

@abstract @access public

Parameters
ilPropertyFormGUI$form

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ isSaveableInPageObjectEditingMode()

ilAssQuestionFeedback::isSaveableInPageObjectEditingMode ( )

returns the fact wether the feedback editing form is saveable in page object editing or not.

by default all properties are edited as page object unless there are additional settings (this method can be overwritten per question type if required)

@access public

Returns
boolean $isSaveableInPageObjectEditingMode

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback.

Definition at line 254 of file class.ilAssQuestionFeedback.php.

255 {
256 return false;
257 }

◆ isValidFeedbackPageObjectType()

static ilAssQuestionFeedback::isValidFeedbackPageObjectType (   $feedbackPageObjectType)
staticfinal

returns the fact wether the given page object type relates to generic or specific feedback page objects

@final

@access public

Parameters
string$feedbackPageObjectType
Returns
array $validFeedbackPageObjectTypes

Definition at line 908 of file class.ilAssQuestionFeedback.php.

909 {
910 switch( $feedbackPageObjectType )
911 {
914
915 return true;
916 }
917
918 return false;
919 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by ilAssQuestionFeedbackPageObjectCommandForwarder\__construct().

+ Here is the caller graph for this function:

◆ migrateContentForLearningModule()

ilAssQuestionFeedback::migrateContentForLearningModule ( ilAssSelfAssessmentMigrator  $migrator,
  $questionId 
)
Parameters
ilAssSelfAssessmentMigrator$migrator
integer$questionId

Definition at line 1022 of file class.ilAssQuestionFeedback.php.

1023 {
1024 $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
1025 $this->getGenericFeedbackContent($questionId, true)
1026 ));
1027
1028 $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
1029 $this->getGenericFeedbackContent($questionId, false)
1030 ));
1031 }

References ilAssSelfAssessmentMigrator\migrateToLmContent(), and saveGenericFeedbackContent().

+ Here is the call graph for this function:

◆ saveGenericFeedbackContent()

ilAssQuestionFeedback::saveGenericFeedbackContent (   $questionId,
  $solutionCompleted,
  $feedbackContent 
)
final

saves GENERIC feedback content for the given question id to the database.

Generic feedback is either feedback for the completed solution (all answers correct) of the question or at least onen incorrect answer.

@final @access public

Parameters
integer$questionId
boolean$solutionCompleted
string$feedbackContent
Returns
integer $feedbackId

Definition at line 381 of file class.ilAssQuestionFeedback.php.

382 {
383 require_once 'Services/RTE/classes/class.ilRTE.php';
384
385 $correctness = $solutionCompleted ? 1 : 0;
386
387 $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
388
389 if( strlen($feedbackContent) )
390 {
391 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
392 }
393
394 if( $feedbackId )
395 {
396 $this->db->update(
398 array(
399 'feedback' => array('clob', $feedbackContent),
400 'tstamp' => array('integer', time())
401 ),
402 array(
403 'feedback_id' => array('integer', $feedbackId)
404 )
405 );
406 }
407 else
408 {
409 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
410
411 $this->db->insert($this->getGenericFeedbackTableName(), array(
412 'feedback_id' => array('integer', $feedbackId),
413 'question_fi' => array('integer', $questionId),
414 'correctness' => array('text', $correctness), // text ?
415 'feedback' => array('clob', $feedbackContent),
416 'tstamp' => array('integer', time())
417 ));
418 }
419
420 return $feedbackId;
421 }

References ilRTE\_replaceMediaObjectImageSrc(), getGenericFeedbackId(), and getGenericFeedbackTableName().

Referenced by getGenericFeedbackPageObjectId(), importGenericFeedback(), migrateContentForLearningModule(), and saveGenericFormProperties().

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

◆ saveGenericFormProperties()

ilAssQuestionFeedback::saveGenericFormProperties ( ilPropertyFormGUI  $form)
final

saves a given form object's GENERIC form properties relating to all question types

@final @access public

Parameters
ilPropertyFormGUI$form

Definition at line 227 of file class.ilAssQuestionFeedback.php.

228 {
229 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
230 {
231 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, $form->getInput('feedback_incomplete'));
232 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, $form->getInput('feedback_complete'));
233 }
234 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput(), and saveGenericFeedbackContent().

+ Here is the call graph for this function:

◆ saveSpecificAnswerFeedbackContent()

ilAssQuestionFeedback::saveSpecificAnswerFeedbackContent (   $questionId,
  $answerIndex,
  $feedbackContent 
)
abstract

saves SPECIFIC feedback content for the given question id and answer index to the database.

@abstract @access public

Parameters
integer$questionId
integer$answerIndex
string$feedbackContent
Returns
integer $feedbackId

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ saveSpecificFormProperties()

ilAssQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

@abstract @access public

Parameters
ilPropertyFormGUI$form

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ setPageObjectOutputMode()

ilAssQuestionFeedback::setPageObjectOutputMode (   $a_val)
final

Set page object output mode.

Parameters
string$a_valpage output mode

Definition at line 701 of file class.ilAssQuestionFeedback.php.

702 {
703 $this->page_obj_output_mode = $a_val;
704 }

◆ syncFeedback()

ilAssQuestionFeedback::syncFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
final

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

@final @access public

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Definition at line 544 of file class.ilAssQuestionFeedback.php.

545 {
546 $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
547 $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
548 }
syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question

References syncGenericFeedback(), and syncSpecificFeedback().

+ Here is the call graph for this function:

◆ syncGenericFeedback()

ilAssQuestionFeedback::syncGenericFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
finalprivate

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

@final @access private

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Definition at line 558 of file class.ilAssQuestionFeedback.php.

559 {
560 // delete generic feedback of the original question
561 $this->db->manipulateF(
562 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($originalQuestionId)
563 );
564
565 // get generic feedback of the actual (duplicated) question
566 $result = $this->db->queryF(
567 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($duplicateQuestionId)
568 );
569
570 // save generic feedback to the original question
571 while( $row = $this->db->fetchAssoc($result) )
572 {
573 $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
574
575 $this->db->insert($this->getGenericFeedbackTableName(), array(
576 'feedback_id' => array('integer', $nextId),
577 'question_fi' => array('integer', $originalQuestionId),
578 'correctness' => array('text', $row['correctness']),
579 'feedback' => array('clob', $row['feedback']),
580 'tstamp' => array('integer', time())
581 ));
582 }
583 }
$result

References $result, $row, and getGenericFeedbackTableName().

Referenced by syncFeedback().

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

◆ syncSpecificFeedback()

ilAssQuestionFeedback::syncSpecificFeedback (   $originalQuestionId,
  $duplicateQuestionId 
)
abstractprotected

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

@abstract @access protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Reimplemented in ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by syncFeedback().

+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilAssQuestionFeedback::$ctrl = null
protected

Definition at line 58 of file class.ilAssQuestionFeedback.php.

Referenced by __construct().

◆ $db

ilAssQuestionFeedback::$db = null
protected

Definition at line 66 of file class.ilAssQuestionFeedback.php.

Referenced by __construct().

◆ $lng

ilAssQuestionFeedback::$lng = null
protected

Definition at line 74 of file class.ilAssQuestionFeedback.php.

Referenced by __construct().

◆ $page_obj_output_mode

ilAssQuestionFeedback::$page_obj_output_mode = "presentation"
protected

Definition at line 82 of file class.ilAssQuestionFeedback.php.

Referenced by getPageObjectOutputMode().

◆ $questionOBJ

ilAssQuestionFeedback::$questionOBJ = null
protected

Definition at line 50 of file class.ilAssQuestionFeedback.php.

Referenced by __construct().

◆ CSS_CLASS_FEEDBACK_CORRECT

◆ CSS_CLASS_FEEDBACK_WRONG

◆ FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID

const ilAssQuestionFeedback::FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID = 2

id for page object relating to generic complete solution feedback

Definition at line 37 of file class.ilAssQuestionFeedback.php.

◆ FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID

const ilAssQuestionFeedback::FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID = 1

id for page object relating to generic incomplete solution feedback

Definition at line 32 of file class.ilAssQuestionFeedback.php.

◆ PAGE_OBJECT_TYPE_GENERIC_FEEDBACK

◆ PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK

◆ TABLE_NAME_GENERIC_FEEDBACK

const ilAssQuestionFeedback::TABLE_NAME_GENERIC_FEEDBACK = 'qpl_fb_generic'

table name for specific feedback

Definition at line 42 of file class.ilAssQuestionFeedback.php.

Referenced by getGenericFeedbackTableName().


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