ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 

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 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 91 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 270 of file class.ilAssQuestionFeedback.php.

271 {
272 if($asNonEditable)
273 {
274 require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
275
276 $property = new ilNonEditableValueGUI($label, $postVar, true);
277 }
278 else
279 {
280 require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
281 require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
282
283 $property = new ilTextAreaInputGUI($label, $postVar);
284 $property->setRequired(false);
285 $property->setRows(10);
286 $property->setCols(80);
287
288 if( !$this->questionOBJ->getPreventRteUsage() )
289 {
290 $property->setUseRte(true);
291 $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
292 $property->addPlugin("latex");
293 $property->addButton("latex");
294 $property->addButton("pastelatex");
295 }
296
297 $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
298 }
299
300 return $property;
301 }
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().

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

147 {
149 $this->lng->txt('feedback_complete_solution'), 'feedback_complete',
150 $this->questionOBJ->isAdditionalContentEditingModePageObject()
151 ));
152
154 $this->lng->txt('feedback_incomplete_solution'), 'feedback_incomplete',
155 $this->questionOBJ->isAdditionalContentEditingModePageObject()
156 ));
157 }
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 796 of file class.ilAssQuestionFeedback.php.

797 {
798 $cl = $this->getClassNameByType($pageObjectType);
799 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
800
801 $pageObject = new $cl();
802 $pageObject->setParentId($this->questionOBJ->getId());
803 $pageObject->setId($pageObjectId);
804 $pageObject->setXMLContent($pageObjectContent);
805 $pageObject->createFromXML();
806 }
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 432 of file class.ilAssQuestionFeedback.php.

433 {
434 if( $isAdditionalContentEditingModePageObject )
435 {
438 $this->getGenericFeedbackPageObjectId($questionId, true)
439 );
440
443 $this->getGenericFeedbackPageObjectId($questionId, false)
444 );
445 }
446
447 $this->db->manipulateF(
448 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($questionId)
449 );
450 }
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 471 of file class.ilAssQuestionFeedback.php.

472 {
473 $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
474 $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
475 }
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 486 of file class.ilAssQuestionFeedback.php.

487 {
488 $res = $this->db->queryF(
489 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
490 array('integer'), array($originalQuestionId)
491 );
492
493 while( $row = $this->db->fetchAssoc($res) )
494 {
495 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
496
497 $this->db->insert($this->getGenericFeedbackTableName(), array(
498 'feedback_id' => array('integer', $feedbackId),
499 'question_fi' => array('integer', $duplicateQuestionId),
500 'correctness' => array('text', $row['correctness']),
501 'feedback' => array('clob', $row['feedback']),
502 'tstamp' => array('integer', time())
503 ));
504
505 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
506 {
507 $pageObjectType = $this->getGenericFeedbackPageObjectType();
508 $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
509 }
510 }
511 }
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 819 of file class.ilAssQuestionFeedback.php.

820 {
821 $cl = $this->getClassNameByType($pageObjectType);
822 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
823
824 $pageObject = new $cl($originalPageObjectId);
825 $pageObject->setParentId($duplicatePageObjectParentId);
826 $pageObject->setId($duplicatePageObjectId);
827 $pageObject->createFromXML();
828 }

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 838 of file class.ilAssQuestionFeedback.php.

839 {
841 {
842 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
843 if( ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
844 {
845 $pageObject = new ilAssGenFeedbackPage($pageObjectId);
846 $pageObject->delete();
847 }
848 }
850 {
851 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
852 if( ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
853 {
854 $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
855 $pageObject->delete();
856 }
857 }
858 }
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="")
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 760 of file class.ilAssQuestionFeedback.php.

761 {
763 {
764 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
765 if( !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
766 {
767 $pageObject = new ilAssGenFeedbackPage();
768 $pageObject->setParentId($this->questionOBJ->getId());
769 $pageObject->setId($pageObjectId);
770 $pageObject->createFromXML();
771 }
772 }
774 {
775 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
776 if( !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
777 {
778 $pageObject = new ilAssSpecFeedbackPage();
779 $pageObject->setParentId($this->questionOBJ->getId());
780 $pageObject->setId($pageObjectId);
781 $pageObject->createFromXML();
782 }
783 }
784 }

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 645 of file class.ilAssQuestionFeedback.php.

646 {
647 $gui = ($a_gui)
648 ? "GUI"
649 : "";
650 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
652 {
653 return "ilAssGenFeedbackPage".$gui;
654 }
656 {
657 return "ilAssSpecFeedbackPage".$gui;
658 }
659 }

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 314 of file class.ilAssQuestionFeedback.php.

315 {
316 require_once 'Services/RTE/classes/class.ilRTE.php';
317
318 $correctness = $solutionCompleted ? 1 : 0;
319
320 $res = $this->db->queryF(
321 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
322 array('integer', 'text'), array($questionId, $correctness)
323 );
324
325 $feedbackContent = null;
326
327 while( $row = $this->db->fetchAssoc($res) )
328 {
329 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
330 break;
331 }
332
333 return $feedbackContent;
334 }
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 941 of file class.ilAssQuestionFeedback.php.

942 {
943 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
944 {
945 $genericFeedbackExportPresentation = $this->getPageObjectXML(
947 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
948 );
949 }
950 else
951 {
952 $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
953 }
954
955 return $genericFeedbackExportPresentation;
956 }
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 582 of file class.ilAssQuestionFeedback.php.

583 {
584 $res = $this->db->queryF(
585 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
586 array('integer','text'), array($questionId, (int)$solutionCompleted)
587 );
588
589 $feedbackId = null;
590
591 while( $row = $this->db->fetchAssoc($res) )
592 {
593 $feedbackId = $row['feedback_id'];
594 break;
595 }
596
597 return $feedbackId;
598 }

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 920 of file class.ilAssQuestionFeedback.php.

921 {
922 $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
923
924 if( !$pageObjectId )
925 {
926 $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
927 }
928
929 return $pageObjectId;
930 }
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 868 of file class.ilAssQuestionFeedback.php.

869 {
871 }

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 616 of file class.ilAssQuestionFeedback.php.

617 {
619 }
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 109 of file class.ilAssQuestionFeedback.php.

110 {
111 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
112 {
113 $genericFeedbackTestPresentationHTML = $this->getPageObjectContent(
115 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
116 );
117 }
118 else
119 {
120 $genericFeedbackTestPresentationHTML = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
121 }
122
123 return $genericFeedbackTestPresentationHTML;
124 }
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 713 of file class.ilAssQuestionFeedback.php.

714 {
715 global $ilCtrl;
716
717 $cl = $this->getClassNameByType($pageObjectType, true);
718 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
719
720 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
721
722 $mode = ($ilCtrl->isAsynch())
723 ? "presentation"
724 : $this->getPageObjectOutputMode();
725
726 $pageObjectGUI = new $cl($pageObjectId);
727 $pageObjectGUI->setOutputMode($mode);
728
729 return $pageObjectGUI->presentation($mode);
730 }
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 672 of file class.ilAssQuestionFeedback.php.

673 {
674 $cl = $this->getClassNameByType($pageObjectType, true);
675 $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
676 $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
677
678 $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
679 $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
680
681 return "<a href='$linkHREF'>$linkTEXT</a>";
682 }

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 631 of file class.ilAssQuestionFeedback.php.

632 {
633 $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
634 $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
635
636 return "$link<br /><br />$content";
637 }
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 699 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 741 of file class.ilAssQuestionFeedback.php.

742 {
743 $cl = $this->getClassNameByType($pageObjectType);
744 require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
745
746 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
747
748 $pageObject = new $cl($pageObjectId);
749 return $pageObject->getXMLContent();
750 }

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 979 of file class.ilAssQuestionFeedback.php.

980 {
981 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
982 {
983 $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
984 $pageObjectType = $this->getGenericFeedbackPageObjectType();
985
986 $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
987 }
988 else
989 {
990 $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
991 }
992 }
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 177 of file class.ilAssQuestionFeedback.php.

178 {
179 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
180 {
181 $pageObjectType = $this->getGenericFeedbackPageObjectType();
182
183 $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
184 $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
185 );
186
187 $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
188 $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
189 );
190 }
191 else
192 {
193 $valueFeedbackSolutionComplete = $this->questionOBJ->prepareTextareaOutput(
194 $this->getGenericFeedbackContent($this->questionOBJ->getId(), true)
195 );
196
197 $valueFeedbackSolutionIncomplete = $this->questionOBJ->prepareTextareaOutput(
198 $this->getGenericFeedbackContent($this->questionOBJ->getId(), false)
199 );
200 }
201
202 $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
203 $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
204 }
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 251 of file class.ilAssQuestionFeedback.php.

252 {
253 return false;
254 }

◆ 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 896 of file class.ilAssQuestionFeedback.php.

897 {
898 switch( $feedbackPageObjectType )
899 {
902
903 return true;
904 }
905
906 return false;
907 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by ilAssQuestionFeedbackPageObjectCommandForwarder\__construct().

+ Here is the caller 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 369 of file class.ilAssQuestionFeedback.php.

370 {
371 require_once 'Services/RTE/classes/class.ilRTE.php';
372
373 $correctness = $solutionCompleted ? 1 : 0;
374
375 $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
376
377 if( strlen($feedbackContent) )
378 {
379 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
380 }
381
382 if( $feedbackId )
383 {
384 $this->db->update(
386 array(
387 'feedback' => array('clob', $feedbackContent),
388 'tstamp' => array('integer', time())
389 ),
390 array(
391 'feedback_id' => array('integer', $feedbackId)
392 )
393 );
394 }
395 else
396 {
397 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
398
399 $this->db->insert($this->getGenericFeedbackTableName(), array(
400 'feedback_id' => array('integer', $feedbackId),
401 'question_fi' => array('integer', $questionId),
402 'correctness' => array('text', $correctness), // text ?
403 'feedback' => array('clob', $feedbackContent),
404 'tstamp' => array('integer', time())
405 ));
406 }
407
408 return $feedbackId;
409 }

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

Referenced by getGenericFeedbackPageObjectId(), importGenericFeedback(), 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 224 of file class.ilAssQuestionFeedback.php.

225 {
226 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
227 {
228 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, $form->getInput('feedback_incomplete'));
229 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, $form->getInput('feedback_complete'));
230 }
231 }
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 689 of file class.ilAssQuestionFeedback.php.

690 {
691 $this->page_obj_output_mode = $a_val;
692 }

◆ 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 532 of file class.ilAssQuestionFeedback.php.

533 {
534 $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
535 $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
536 }
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 546 of file class.ilAssQuestionFeedback.php.

547 {
548 // delete generic feedback of the original question
549 $this->db->manipulateF(
550 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($originalQuestionId)
551 );
552
553 // get generic feedback of the actual (duplicated) question
554 $result = $this->db->queryF(
555 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($duplicateQuestionId)
556 );
557
558 // save generic feedback to the original question
559 while( $row = $this->db->fetchAssoc($result) )
560 {
561 $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
562
563 $this->db->insert($this->getGenericFeedbackTableName(), array(
564 'feedback_id' => array('integer', $nextId),
565 'question_fi' => array('integer', $originalQuestionId),
566 'correctness' => array('text', $row['correctness']),
567 'feedback' => array('clob', $row['feedback']),
568 'tstamp' => array('integer', time())
569 ));
570 }
571 }
$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 55 of file class.ilAssQuestionFeedback.php.

Referenced by __construct().

◆ $db

ilAssQuestionFeedback::$db = null
protected

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

Referenced by __construct().

◆ $lng

ilAssQuestionFeedback::$lng = null
protected

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

Referenced by __construct().

◆ $page_obj_output_mode

ilAssQuestionFeedback::$page_obj_output_mode = "presentation"
protected

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

Referenced by getPageObjectOutputMode().

◆ $questionOBJ

ilAssQuestionFeedback::$questionOBJ = null
protected

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

Referenced by __construct().

◆ 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 34 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 29 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 39 of file class.ilAssQuestionFeedback.php.

Referenced by getGenericFeedbackTableName().


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