ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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

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.

92  {
93  $this->questionOBJ = $questionOBJ;
94 
95  $this->ctrl = $ctrl;
96  $this->lng = $lng;
97  $this->db = $db;
98  }

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

protected

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

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

References ilObjAdvancedEditing\_getUsedHTMLTags().

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

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

public

Parameters
ilPropertyFormGUI$form

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

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

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  }
addItem($a_item)
Add Item (Property, SectionHeader).
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
+ 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

public

Parameters
ilPropertyFormGUI$form

Referenced by completeGenericFormProperties().

+ Here is the caller graph for this function:

◆ 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

protected

Parameters
string$pageObjectType
integer$pageObjectId
string$pageObjectContent

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

References getClassNameByType().

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

780  {
781  $cl = $this->getClassNameByType($pageObjectType);
782  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
783 
784  $pageObject = new $cl();
785  $pageObject->setParentId($this->questionOBJ->getId());
786  $pageObject->setId($pageObjectId);
787  $pageObject->setXMLContent($pageObjectContent);
788  $pageObject->createFromXML();
789  }
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
+ 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

public

Parameters
integer$questionId
boolean$isAdditionalContentEditingModePageObject

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

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

423  {
424  if( $isAdditionalContentEditingModePageObject )
425  {
428  $this->getGenericFeedbackPageObjectId($questionId, true)
429  );
430 
433  $this->getGenericFeedbackPageObjectId($questionId, false)
434  );
435  }
436 
437  $this->db->manipulateF(
438  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($questionId)
439  );
440  }
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacks()

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

deletes all SPECIFIC feedback contents for the given question id

public

Parameters
integer$questionId
boolean$isAdditionalContentEditingModePageObject

Referenced by deleteGenericFeedbacks().

+ Here is the caller graph for this function:

◆ 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

public

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

References duplicateGenericFeedback(), and duplicateSpecificFeedback().

462  {
463  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
464  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
465  }
duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
+ 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

private

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

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

Referenced by duplicateFeedback().

477  {
478  $res = $this->db->queryF(
479  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
480  array('integer'), array($originalQuestionId)
481  );
482 
483  while( $row = $this->db->fetchAssoc($res) )
484  {
485  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
486 
487  $this->db->insert($this->getGenericFeedbackTableName(), array(
488  'feedback_id' => array('integer', $feedbackId),
489  'question_fi' => array('integer', $duplicateQuestionId),
490  'correctness' => array('text', $row['correctness']),
491  'feedback' => array('clob', $row['feedback']),
492  'tstamp' => array('integer', time())
493  ));
494 
495  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
496  {
497  $pageObjectType = $this->getGenericFeedbackPageObjectType();
498  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
499  }
500  }
501  }
getGenericFeedbackTableName()
returns the table name for specific feedback
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
+ 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

protected

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

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

References getClassNameByType().

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

803  {
804  $cl = $this->getClassNameByType($pageObjectType);
805  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
806 
807  $pageObject = new $cl($originalPageObjectId);
808  $pageObject->setParentId($duplicatePageObjectParentId);
809  $pageObject->setId($duplicatePageObjectId);
810  $pageObject->createFromXML();
811  }
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
+ 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

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Referenced by duplicateFeedback(), and duplicateGenericFeedback().

+ 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

protected

Parameters
type$pageObjectType
type$pageObjectId

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

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

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

822  {
824  {
825  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
826  if( ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
827  {
828  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
829  $pageObject->delete();
830  }
831  }
833  {
834  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
835  if( ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
836  {
837  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
838  $pageObject->delete();
839  }
840  }
841  }
Generic feedback page object.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
Specific feedback page object.
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ 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

private

Parameters
type$pageObjectType
type$pageObjectId

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

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

Referenced by getPageObjectContent(), and getPageObjectXML().

744  {
746  {
747  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
748  if( !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
749  {
750  $pageObject = new ilAssGenFeedbackPage();
751  $pageObject->setParentId($this->questionOBJ->getId());
752  $pageObject->setId($pageObjectId);
753  $pageObject->createFromXML();
754  }
755  }
757  {
758  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
759  if( !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
760  {
761  $pageObject = new ilAssSpecFeedbackPage();
762  $pageObject->setParentId($this->questionOBJ->getId());
763  $pageObject->setId($pageObjectId);
764  $pageObject->createFromXML();
765  }
766  }
767  }
Generic feedback page object.
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
Specific feedback page object.
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClassNameByType()

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

Get class name by type.

Parameters

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

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

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

636  {
637  $gui = ($a_gui)
638  ? "GUI"
639  : "";
640  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
642  {
643  return "ilAssGenFeedbackPage".$gui;
644  }
646  {
647  return "ilAssSpecFeedbackPage".$gui;
648  }
649  }
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
+ 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.

public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $feedbackContent

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

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

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

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)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
+ 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

public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $genericFeedbackExportPresentation

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

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

925  {
926  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
927  {
928  $genericFeedbackExportPresentation = $this->getPageObjectXML(
930  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
931  );
932  }
933  else
934  {
935  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
936  }
937 
938  return $genericFeedbackExportPresentation;
939  }
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getPageObjectXML($pageObjectType, $pageObjectId)
returns the xml of page object with given type and id
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
+ 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.

protected

Parameters
integer$questionId
boolean$answerIndex
Returns
string $feedbackId

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

References $res, $row, and syncSpecificFeedback().

Referenced by getGenericFeedbackPageObjectId(), and saveGenericFeedbackContent().

573  {
574  $res = $this->db->queryF(
575  "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
576  array('integer','text'), array($questionId, (int)$solutionCompleted)
577  );
578 
579  $feedbackId = null;
580 
581  while( $row = $this->db->fetchAssoc($res) )
582  {
583  $feedbackId = $row['feedback_id'];
584  break;
585  }
586 
587  return $feedbackId;
588  }
+ Here is the call graph for this function:
+ 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)

protected

Parameters
integer$questionId
boolean$solutionCompleted
Returns
integer $pageObjectId

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

References getGenericFeedbackId(), and saveGenericFeedbackContent().

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

904  {
905  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
906 
907  if( !$pageObjectId )
908  {
909  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
910  }
911 
912  return $pageObjectId;
913  }
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.
+ 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

protected

Returns
string $genericFeedbackPageObjectType

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

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

852  {
853  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
854  }
+ Here is the caller graph for this function:

◆ getGenericFeedbackTableName()

ilAssQuestionFeedback::getGenericFeedbackTableName ( )
finalprotected

returns the table name for specific feedback

Returns
string $specificFeedbackTableName

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

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

607  {
608  return self::TABLE_NAME_GENERIC_FEEDBACK;
609  }
+ 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)

public

Parameters
integer$questionId
boolean$solutionCompleted
Returns
string $genericFeedbackTestPresentationHTML

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

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

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  }
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
+ 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

protected

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectContent

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

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

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

704  {
705  $cl = $this->getClassNameByType($pageObjectType, true);
706  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
707 
708  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
709 
710  $pageObjectGUI = new $cl($pageObjectId);
711  $pageObjectGUI->setOutputMode($this->getPageObjectOutputMode());
712  return $pageObjectGUI->presentation($this->getPageObjectOutputMode());
713  }
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with given type and id
getPageObjectOutputMode()
Get page object output mode.
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
+ 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

private

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectEditingLink

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

References getClassNameByType().

Referenced by getPageObjectNonEditableValueHTML().

663  {
664  $cl = $this->getClassNameByType($pageObjectType, true);
665  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
666  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
667 
668  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
669  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
670 
671  return "<a href='$linkHREF'>$linkTEXT</a>";
672  }
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
+ 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

protected

Parameters
string$pageObjectType
integer$pageObjectId
Returns
string $nonEditableValueHTML

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

References getPageObjectContent(), and getPageObjectEditingLink().

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

622  {
623  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
624  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
625 
626  return "$link<br /><br />$content";
627  }
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
getPageObjectEditingLink($pageObjectType, $pageObjectId)
returns a link to page object editor for page object with given type and id
+ 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 689 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

protected

Parameters
type$pageObjectType
type$pageObjectId
Returns
string $pageObjectXML

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

References ensurePageObjectExists(), and getClassNameByType().

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

725  {
726  $cl = $this->getClassNameByType($pageObjectType);
727  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
728 
729  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
730 
731  $pageObject = new $cl($pageObjectId);
732  return $pageObject->getXMLContent();
733  }
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with given type and id
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
+ 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.

public

Parameters
integer$questionId
integer$answerIndex
Returns
string $feedbackContent

Referenced by getGenericFeedbackContent().

+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackExportPresentation()

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

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

public

Parameters
integer$questionId
integer$answerIndex
Returns
string $specificFeedbackExportPresentation

Referenced by getGenericFeedbackExportPresentation().

+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackPageObjectType()

ilAssQuestionFeedback::getSpecificAnswerFeedbackPageObjectType ( )
finalprotected

◆ getSpecificAnswerFeedbackTestPresentation()

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

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

public

Parameters
integer$questionId
integer$answerIndex
Returns
string $specificAnswerFeedbackTestPresentationHTML

Referenced by getGenericFeedbackTestPresentation().

+ Here is the caller graph for this function:

◆ 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

public

Parameters
integer$questionId
boolean$solutionCompleted
string$feedbackContent

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

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

963  {
964  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
965  {
966  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
967  $pageObjectType = $this->getGenericFeedbackPageObjectType();
968 
969  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
970  }
971  else
972  {
973  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
974  }
975  }
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
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
saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
+ 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

public

Parameters
integer$questionId
integer$answerIndex
string$feedbackContent

Referenced by importGenericFeedback().

+ Here is the caller graph for this function:

◆ initGenericFormProperties()

ilAssQuestionFeedback::initGenericFormProperties ( ilPropertyFormGUI  $form)
final

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

public

Parameters
ilPropertyFormGUI$form

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

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

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  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.
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
+ 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

public

Parameters
ilPropertyFormGUI$form

Referenced by initGenericFormProperties().

+ Here is the caller graph for this function:

◆ 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)

public

Returns
boolean $isSaveableInPageObjectEditingMode

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

public

Parameters
string$feedbackPageObjectType
Returns
array $validFeedbackPageObjectTypes

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

Referenced by ilAssQuestionFeedbackPageObjectCommandForwarder\__construct().

880  {
881  switch( $feedbackPageObjectType )
882  {
883  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
884  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
885 
886  return true;
887  }
888 
889  return false;
890  }
+ 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.

public

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

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

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

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

360  {
361  require_once 'Services/RTE/classes/class.ilRTE.php';
362 
363  $correctness = $solutionCompleted ? 1 : 0;
364 
365  $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
366 
367  if( strlen($feedbackContent) )
368  {
369  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
370  }
371 
372  if( $feedbackId )
373  {
374  $this->db->update(
376  array(
377  'feedback' => array('clob', $feedbackContent),
378  'tstamp' => array('integer', time())
379  ),
380  array(
381  'feedback_id' => array('integer', $feedbackId)
382  )
383  );
384  }
385  else
386  {
387  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
388 
389  $this->db->insert($this->getGenericFeedbackTableName(), array(
390  'feedback_id' => array('integer', $feedbackId),
391  'question_fi' => array('integer', $questionId),
392  'correctness' => array('text', $correctness), // text ?
393  'feedback' => array('clob', $feedbackContent),
394  'tstamp' => array('integer', time())
395  ));
396  }
397 
398  return $feedbackId;
399  }
getGenericFeedbackTableName()
returns the table name for specific feedback
static _replaceMediaObjectImageSrc($a_text, $a_direction=0)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
getGenericFeedbackId($questionId, $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index. ...
+ 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

public

Parameters
ilPropertyFormGUI$form

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

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

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.
saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
+ 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.

public

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

Referenced by saveGenericFeedbackContent().

+ Here is the caller graph for this function:

◆ saveSpecificFormProperties()

ilAssQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

public

Parameters
ilPropertyFormGUI$form

Referenced by saveGenericFormProperties().

+ Here is the caller graph for this function:

◆ setPageObjectOutputMode()

ilAssQuestionFeedback::setPageObjectOutputMode (   $a_val)
final

Set page object output mode.

Parameters
string$a_valpage output mode

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

680  {
681  $this->page_obj_output_mode = $a_val;
682  }

◆ syncFeedback()

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

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

public

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

References syncGenericFeedback(), and syncSpecificFeedback().

523  {
524  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
525  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
526  }
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...
syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question ...
+ 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

private

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

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

Referenced by syncFeedback().

537  {
538  // delete generic feedback of the original question
539  $this->db->manipulateF(
540  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($originalQuestionId)
541  );
542 
543  // get generic feedback of the actual (duplicated) question
544  $result = $this->db->queryF(
545  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($duplicateQuestionId)
546  );
547 
548  // save generic feedback to the original question
549  while( $row = $this->db->fetchAssoc($result) )
550  {
551  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
552 
553  $this->db->insert($this->getGenericFeedbackTableName(), array(
554  'feedback_id' => array('integer', $nextId),
555  'question_fi' => array('integer', $originalQuestionId),
556  'correctness' => array('text', $row['correctness']),
557  'feedback' => array('clob', $row['feedback']),
558  'tstamp' => array('integer', time())
559  ));
560  }
561  }
$result
getGenericFeedbackTableName()
returns the table name for specific feedback
+ 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

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

Referenced by getGenericFeedbackId(), and 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

const ilAssQuestionFeedback::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK = 'qfbg'

◆ PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK

const ilAssQuestionFeedback::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK = 'qfbs'

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


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