ILIAS  release_8 Revision v8.19
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, ilDBInterface $db, ilLanguage $lng)
 constructor More...
 
 getGenericFeedbackTestPresentation (int $questionId, bool $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 (int $questionId, int $questionIndex, int $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 (int $questionId, bool $solutionCompleted)
 returns the GENERIC feedback content for a given question state. More...
 
 getSpecificAnswerFeedbackContent (int $questionId, int $questionIndex, int $answerIndex)
 
 getAllSpecificAnswerFeedbackContents (int $questionId)
 
 isSpecificAnswerFeedbackAvailable (int $questionId)
 
 saveGenericFeedbackContent (int $questionId, bool $solutionCompleted, string $feedbackContent)
 saves GENERIC feedback content for the given question id to the database. More...
 
 saveSpecificAnswerFeedbackContent (int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
 
 deleteGenericFeedbacks (int $questionId, bool $isAdditionalContentEditingModePageObject)
 deletes all GENERIC feedback contents (and page objects if required) for the given question id More...
 
 deleteSpecificAnswerFeedbacks (int $questionId, bool $isAdditionalContentEditingModePageObject)
 
 duplicateFeedback (int $originalQuestionId, int $duplicateQuestionId)
 duplicates the feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the feedback from a duplicated question back to the original question More...
 
 checkFeedbackParent (int $feedbackId)
 
 getClassNameByType (string $a_type, bool $a_gui=false)
 
 setPageObjectOutputMode (string $page_obj_output_mode)
 
 getPageObjectOutputMode ()
 
 getGenericFeedbackExportPresentation (int $questionId, bool $solutionCompleted)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 getSpecificAnswerFeedbackExportPresentation (int $questionId, int $questionIndex, int $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importGenericFeedback (int $questionId, bool $solutionCompleted, string $feedbackContent)
 imports the given feedback content as generic feedback for the given question id for either the complete or incomplete solution More...
 
 importSpecificAnswerFeedback (int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator, int $questionId)
 

Static Public Member Functions

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

Data Fields

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

Protected Member Functions

 buildFeedbackContentFormProperty (string $label, string $postVar, bool $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 (int $originalQuestionId, int $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 getGenericFeedbackId (int $questionId, bool $solutionCompleted)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 isGenericFeedbackId (int $feedbackId)
 
 isSpecificAnswerFeedbackId (int $feedbackId)
 
 syncSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 getGenericFeedbackTableName ()
 
 getPageObjectNonEditableValueHTML (string $pageObjectType, int $pageObjectId)
 returns html content to be used as value for non editable value form properties in feedback editing form More...
 
 getPageObjectContent (string $pageObjectType, int $pageObjectId)
 
 getPageObjectXML (string $pageObjectType, int $pageObjectId)
 
 createPageObject (string $pageObjectType, int $pageObjectId, string $pageObjectContent)
 
 duplicatePageObject (string $pageObjectType, int $originalPageObjectId, int $duplicatePageObjectId, int $duplicatePageObjectParentId)
 
 ensurePageObjectDeleted (string $pageObjectType, int $pageObjectId)
 
 getGenericFeedbackPageObjectType ()
 
 getSpecificAnswerFeedbackPageObjectType ()
 
 getGenericFeedbackPageObjectId (int $questionId, bool $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...
 
 cleanupPageContent (string $content)
 

Protected Attributes

assQuestion $questionOBJ
 
ilCtrl $ctrl
 
ilDBInterface $db
 
ilLanguage $lng
 
string $page_obj_output_mode = "presentation"
 

Private Member Functions

 duplicateGenericFeedback (int $originalQuestionId, int $duplicateQuestionId)
 duplicates the GENERIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncGenericFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the GENERIC feedback from a duplicated question back to the original question More...
 
 getPageObjectEditingLink (string $pageObjectType, int $pageObjectId)
 
 ensurePageObjectExists (string $pageObjectType, int $pageObjectId)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

constructor

public

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

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

References $ctrl, $db, $lng, $questionOBJ, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildFeedbackContentFormProperty()

ilAssQuestionFeedback::buildFeedbackContentFormProperty ( string  $label,
string  $postVar,
bool  $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
    Returns
    ilTextAreaInputGUI|ilNonEditableValueGUI

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

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

Referenced by ilAssClozeTestFeedback\completeFbPropsForNumericGap(), ilAssClozeTestFeedback\completeFbPropsForSelectGap(), ilAssClozeTestFeedback\completeFbPropsForTextGap(), ilAssClozeTestFeedback\completeFormPropsForFeedbackModeGapQuestion(), completeGenericFormProperties(), ilAssConfigurableMultiOptionQuestionFeedback\completeSpecificFormProperties(), and ilAssMultiOptionQuestionFeedback\completeSpecificFormProperties().

223  {
224  if ($asNonEditable) {
225  $property = new ilNonEditableValueGUI($label, $postVar, true);
226  } else {
227  $property = new ilTextAreaInputGUI($label, $postVar);
228  $property->setRequired(false);
229  $property->setRows(10);
230  $property->setCols(80);
231 
232  if (!$this->questionOBJ->getPreventRteUsage()) {
233  $property->setUseRte(true);
234  $property->addPlugin("latex");
235  $property->addButton("latex");
236  $property->addButton("pastelatex");
237 
238  $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
239  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
240  } else {
242  $property->setUseTagsForRteOnly(false);
243  }
244 
245  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
246  }
247 
248  return $property;
249  }
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkFeedbackParent()

ilAssQuestionFeedback::checkFeedbackParent ( int  $feedbackId)
final

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

References isGenericFeedbackId(), isSpecificAnswerFeedbackId(), and syncSpecificFeedback().

495  : bool
496  {
497  if ($this->isGenericFeedbackId($feedbackId)) {
498  return true;
499  }
500 
501  if ($this->isSpecificAnswerFeedbackId($feedbackId)) {
502  return true;
503  }
504 
505  return false;
506  }
isSpecificAnswerFeedbackId(int $feedbackId)
+ Here is the call graph for this function:

◆ cleanupPageContent()

ilAssQuestionFeedback::cleanupPageContent ( string  $content)
protected

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

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

739  : string
740  {
741  $doc = new DOMDocument('1.0', 'UTF-8');
742  if (@$doc->loadHTML('<html><body>' . $content . '</body></html>')) {
743  $xpath = new DOMXPath($doc);
744  $nodes_after_comments = $xpath->query('//comment()/following-sibling::*[1]');
745  foreach ($nodes_after_comments as $node_after_comments) {
746  if (trim($node_after_comments->nodeValue) === ''
747  && $node_after_comments->childElementCount === 0) {
748  return '';
749  }
750  }
751  }
752  return $content;
753  }
+ 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

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

References ilPropertyFormGUI\addItem(), buildFeedbackContentFormProperty(), completeSpecificFormProperties(), and ILIAS\Repository\lng().

121  : void
122  {
124  $this->lng->txt('feedback_complete_solution'),
125  'feedback_complete',
126  $this->questionOBJ->isAdditionalContentEditingModePageObject()
127  ));
128 
130  $this->lng->txt('feedback_incomplete_solution'),
131  'feedback_incomplete',
132  $this->questionOBJ->isAdditionalContentEditingModePageObject()
133  ));
134  }
buildFeedbackContentFormProperty(string $label, string $postVar, bool $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 ( string  $pageObjectType,
int  $pageObjectId,
string  $pageObjectContent 
)
finalprotected

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

References getClassNameByType().

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

606  : void
607  {
608  $cl = $this->getClassNameByType($pageObjectType);
609 
610  $pageObject = new $cl();
611  $pageObject->setParentId($this->questionOBJ->getId());
612  $pageObject->setId($pageObjectId);
613  $pageObject->setXMLContent($pageObjectContent);
614  $pageObject->createFromXML();
615  }
getClassNameByType(string $a_type, bool $a_gui=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteGenericFeedbacks()

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

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

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

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

349  : void
350  {
351  if ($isAdditionalContentEditingModePageObject) {
354  $this->getGenericFeedbackPageObjectId($questionId, true)
355  );
356 
359  $this->getGenericFeedbackPageObjectId($questionId, false)
360  );
361  }
362 
363  $this->db->manipulateF(
364  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
365  array('integer'),
366  array($questionId)
367  );
368  }
ensurePageObjectDeleted(string $pageObjectType, int $pageObjectId)
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacks()

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

Referenced by deleteGenericFeedbacks().

+ Here is the caller graph for this function:

◆ duplicateFeedback()

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

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

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

References duplicateGenericFeedback(), and duplicateSpecificFeedback().

376  : void
377  {
378  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
379  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
380  }
duplicateSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
duplicateGenericFeedback(int $originalQuestionId, int $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
+ Here is the call graph for this function:

◆ duplicateGenericFeedback()

ilAssQuestionFeedback::duplicateGenericFeedback ( int  $originalQuestionId,
int  $duplicateQuestionId 
)
private

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

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

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

Referenced by duplicateFeedback().

386  : void
387  {
388  $res = $this->db->queryF(
389  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
390  array('integer'),
391  array($originalQuestionId)
392  );
393 
394  while ($row = $this->db->fetchAssoc($res)) {
395  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
396 
397  $this->db->insert($this->getGenericFeedbackTableName(), array(
398  'feedback_id' => array('integer', $feedbackId),
399  'question_fi' => array('integer', $duplicateQuestionId),
400  'correctness' => array('text', $row['correctness']),
401  'feedback' => array('clob', $row['feedback']),
402  'tstamp' => array('integer', time())
403  ));
404 
405  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
406  $pageObjectType = $this->getGenericFeedbackPageObjectType();
407  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
408  }
409  }
410  }
duplicatePageObject(string $pageObjectType, int $originalPageObjectId, int $duplicatePageObjectId, int $duplicatePageObjectParentId)
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicatePageObject()

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

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

References ensurePageObjectExists(), and getClassNameByType().

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

617  : void
618  {
619  $this->ensurePageObjectExists($pageObjectType, $originalPageObjectId);
620 
621  $cl = $this->getClassNameByType($pageObjectType);
622 
623  $pageObject = new $cl($originalPageObjectId);
624  $pageObject->setParentId($duplicatePageObjectParentId);
625  $pageObject->setId($duplicatePageObjectId);
626  $pageObject->createFromXML();
627  }
getClassNameByType(string $a_type, bool $a_gui=false)
ensurePageObjectExists(string $pageObjectType, int $pageObjectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateSpecificFeedback()

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

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

Referenced by duplicateFeedback(), and duplicateGenericFeedback().

+ Here is the caller graph for this function:

◆ ensurePageObjectDeleted()

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

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

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

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

629  : void
630  {
632  if (ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
633  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
634  $pageObject->delete();
635  }
636  }
638  if (ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
639  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
640  $pageObject->delete();
641  }
642  }
643  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 ( string  $pageObjectType,
int  $pageObjectId 
)
private

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

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

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

588  : void
589  {
591  && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
592  $pageObject = new ilAssGenFeedbackPage();
593  $pageObject->setParentId($this->questionOBJ->getId());
594  $pageObject->setId($pageObjectId);
595  $pageObject->createFromXML();
596  }
598  && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
599  $pageObject = new ilAssSpecFeedbackPage();
600  $pageObject->setParentId($this->questionOBJ->getId());
601  $pageObject->setId($pageObjectId);
602  $pageObject->createFromXML();
603  }
604  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:

◆ getAllSpecificAnswerFeedbackContents()

ilAssQuestionFeedback::getAllSpecificAnswerFeedbackContents ( int  $questionId)
abstract

Referenced by getGenericFeedbackContent().

+ Here is the caller graph for this function:

◆ getClassNameByType()

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

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

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

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

530  : string
531  {
532  $gui = ($a_gui) ? "GUI" : "";
533 
535  return "ilAssGenFeedbackPage" . $gui;
536  }
537 
538  //if ($a_type == ilAssQuestionFeedback::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK) {
539  return "ilAssSpecFeedbackPage" . $gui;
540  }
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
+ Here is the caller graph for this function:

◆ getGenericFeedbackContent()

ilAssQuestionFeedback::getGenericFeedbackContent ( int  $questionId,
bool  $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.

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

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

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

256  : string
257  {
258  $res = $this->db->queryF(
259  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
260  array('integer', 'text'),
261  array($questionId, (int) $solutionCompleted)
262  );
263 
264  $feedbackContent = '';
265 
266  if ($this->db->numRows($res) > 0) {
267  $row = $this->db->fetchAssoc($res);
268  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc(
269  $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($row['feedback'] ?? ''),
270  1
271  );
272  }
273  return $feedbackContent;
274  }
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGenericFeedbackExportPresentation()

ilAssQuestionFeedback::getGenericFeedbackExportPresentation ( int  $questionId,
bool  $solutionCompleted 
)

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

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

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

690  : string
691  {
692  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
693  $genericFeedbackExportPresentation = $this->getPageObjectXML(
695  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
696  );
697  } else {
698  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
699  }
700 
701  return $genericFeedbackExportPresentation;
702  }
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getGenericFeedbackContent(int $questionId, bool $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getPageObjectXML(string $pageObjectType, int $pageObjectId)
+ Here is the call graph for this function:

◆ getGenericFeedbackId()

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

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

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

References $res, and ILIAS\Repository\int().

Referenced by getGenericFeedbackPageObjectId(), and saveGenericFeedbackContent().

463  : int
464  {
465  $res = $this->db->queryF(
466  "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
467  array('integer','text'),
468  array($questionId, (int) $solutionCompleted)
469  );
470 
471  $feedbackId = -1;
472  if ($this->db->numRows($res)) {
473  $row = $this->db->fetchAssoc($res);
474  $feedbackId = (int) $row['feedback_id'];
475  }
476 
477  return $feedbackId;
478  }
$res
Definition: ltiservices.php:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGenericFeedbackPageObjectId()

ilAssQuestionFeedback::getGenericFeedbackPageObjectId ( int  $questionId,
bool  $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)

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

References getGenericFeedbackId(), and saveGenericFeedbackContent().

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

675  : int
676  {
677  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
678 
679  if ($pageObjectId == -1) {
680  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, '');
681  }
682 
683  return $pageObjectId;
684  }
getGenericFeedbackId(int $questionId, bool $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index. ...
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $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

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

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

645  : string
646  {
647  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
648  }
+ Here is the caller graph for this function:

◆ getGenericFeedbackTableName()

ilAssQuestionFeedback::getGenericFeedbackTableName ( )
finalprotected

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

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

513  : string
514  {
515  return self::TABLE_NAME_GENERIC_FEEDBACK;
516  }
+ Here is the caller graph for this function:

◆ getGenericFeedbackTestPresentation()

ilAssQuestionFeedback::getGenericFeedbackTestPresentation ( int  $questionId,
bool  $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)

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

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

88  : string
89  {
90  if ($this->page_obj_output_mode == "edit") {
91  return '';
92  }
93  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
94  return $this->cleanupPageContent(
95  $this->getPageObjectContent(
97  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
98  )
99  );
100  }
101  return $this->getGenericFeedbackContent($questionId, $solutionCompleted);
102  }
getPageObjectContent(string $pageObjectType, int $pageObjectId)
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getGenericFeedbackContent(int $questionId, bool $solutionCompleted)
returns the GENERIC feedback content for a given question state.
+ Here is the call graph for this function:

◆ getPageObjectContent()

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

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

References ILIAS\Repository\ctrl(), ensurePageObjectExists(), getClassNameByType(), and getPageObjectOutputMode().

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

564  : string
565  {
566  $cl = $this->getClassNameByType($pageObjectType, true);
567 
568  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
569 
570  $mode = ($this->ctrl->isAsynch()) ? "presentation" : $this->getPageObjectOutputMode();
571 
572  $pageObjectGUI = new $cl($pageObjectId);
573  $pageObjectGUI->setOutputMode($mode);
574 
575  return $pageObjectGUI->presentation($mode);
576  }
getClassNameByType(string $a_type, bool $a_gui=false)
ensurePageObjectExists(string $pageObjectType, int $pageObjectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageObjectEditingLink()

ilAssQuestionFeedback::getPageObjectEditingLink ( string  $pageObjectType,
int  $pageObjectId 
)
private

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

References ILIAS\Repository\ctrl(), getClassNameByType(), and ILIAS\Repository\lng().

Referenced by getPageObjectNonEditableValueHTML().

542  : string
543  {
544  $cl = $this->getClassNameByType($pageObjectType, true);
545  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
546  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
547 
548  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
549  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
550 
551  return "<a href='$linkHREF'>$linkTEXT</a>";
552  }
getClassNameByType(string $a_type, bool $a_gui=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageObjectNonEditableValueHTML()

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

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

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

References getPageObjectContent(), and getPageObjectEditingLink().

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

522  : string
523  {
524  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
525  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
526 
527  return "$link<br /><br />$content";
528  }
getPageObjectContent(string $pageObjectType, int $pageObjectId)
getPageObjectEditingLink(string $pageObjectType, int $pageObjectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPageObjectOutputMode()

ilAssQuestionFeedback::getPageObjectOutputMode ( )
final

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

References $page_obj_output_mode.

Referenced by getPageObjectContent().

559  : string
560  {
562  }
+ Here is the caller graph for this function:

◆ getPageObjectXML()

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

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

References ensurePageObjectExists(), and getClassNameByType().

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

578  : string
579  {
580  $cl = $this->getClassNameByType($pageObjectType);
581 
582  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
583 
584  $pageObject = new $cl($pageObjectId);
585  return $pageObject->getXMLContent();
586  }
getClassNameByType(string $a_type, bool $a_gui=false)
ensurePageObjectExists(string $pageObjectType, int $pageObjectId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackContent()

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

Referenced by getGenericFeedbackContent().

+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackExportPresentation()

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

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

Referenced by getGenericFeedbackExportPresentation(), and isSpecificAnswerFeedbackAvailable().

+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackPageObjectType()

◆ getSpecificAnswerFeedbackTestPresentation()

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

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

public

Parameters
integer$questionId
integer$questionIndex
integer$answerIndex
Returns
string $specificAnswerFeedbackTestPresentationHTML

Referenced by getGenericFeedbackTestPresentation().

+ Here is the caller graph for this function:

◆ importGenericFeedback()

ilAssQuestionFeedback::importGenericFeedback ( int  $questionId,
bool  $solutionCompleted,
string  $feedbackContent 
)

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

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

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

714  : void
715  {
716  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
717  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
718  $pageObjectType = $this->getGenericFeedbackPageObjectType();
719 
720  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
721  } else {
722  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
723  }
724  }
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
createPageObject(string $pageObjectType, int $pageObjectId, string $pageObjectContent)
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
+ Here is the call graph for this function:

◆ importSpecificAnswerFeedback()

ilAssQuestionFeedback::importSpecificAnswerFeedback ( int  $questionId,
int  $questionIndex,
int  $answerIndex,
string  $feedbackContent 
)
abstract

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

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

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

150  : void
151  {
152  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
153  $pageObjectType = $this->getGenericFeedbackPageObjectType();
154 
155  $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
156  $pageObjectType,
157  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
158  );
159 
160  $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
161  $pageObjectType,
162  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
163  );
164  } else {
165  $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
166  $this->questionOBJ->getId(),
167  true
168  );
169 
170  $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
171  $this->questionOBJ->getId(),
172  false
173  );
174  }
175 
176  $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
177  $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
178  }
getItemByPostVar(string $a_post_var)
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getGenericFeedbackContent(int $questionId, bool $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getPageObjectNonEditableValueHTML(string $pageObjectType, int $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
+ 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

Referenced by initGenericFormProperties().

+ Here is the caller graph for this function:

◆ isGenericFeedbackId()

ilAssQuestionFeedback::isGenericFeedbackId ( int  $feedbackId)
protected

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

References isSpecificAnswerFeedbackId().

Referenced by checkFeedbackParent().

480  : bool
481  {
482  $row = $this->db->fetchAssoc($this->db->queryF(
483  "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()}
484  WHERE question_fi = %s AND feedback_id = %s",
485  array('integer','integer'),
486  array($this->questionOBJ->getId(), $feedbackId)
487  ));
488 
489 
490  return (bool) $row['cnt'];
491  }
+ Here is the call graph for this function:
+ 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)

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

209  : bool
210  {
211  return false;
212  }

◆ isSpecificAnswerFeedbackAvailable()

ilAssQuestionFeedback::isSpecificAnswerFeedbackAvailable ( int  $questionId)

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

References $res, and getSpecificAnswerFeedbackExportPresentation().

280  : bool
281  {
282  $res = $this->db->queryF(
283  "SELECT answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
284  ['integer'],
285  [$questionId]
286  );
287 
288  $allFeedbackContents = '';
289 
290  while ($row = $this->db->fetchAssoc($res)) {
291  $allFeedbackContents .= $this->getSpecificAnswerFeedbackExportPresentation(
292  $this->questionOBJ->getId(),
293  0,
294  $row['answer']
295  );
296  }
297 
298  return (bool) strlen(trim(strip_tags($allFeedbackContents)));
299  }
$res
Definition: ltiservices.php:69
getSpecificAnswerFeedbackExportPresentation(int $questionId, int $questionIndex, int $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
+ Here is the call graph for this function:

◆ isSpecificAnswerFeedbackId()

ilAssQuestionFeedback::isSpecificAnswerFeedbackId ( int  $feedbackId)
abstractprotected

Referenced by checkFeedbackParent(), and isGenericFeedbackId().

+ Here is the caller graph for this function:

◆ isValidFeedbackPageObjectType()

static ilAssQuestionFeedback::isValidFeedbackPageObjectType ( string  $feedbackPageObjectType)
staticfinal

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

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

Referenced by ilAssQuestionFeedbackPageObjectCommandForwarder\__construct().

659  : bool
660  {
661  switch ($feedbackPageObjectType) {
662  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
663  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
664  return true;
665  }
666 
667  return false;
668  }
+ Here is the caller graph for this function:

◆ migrateContentForLearningModule()

ilAssQuestionFeedback::migrateContentForLearningModule ( ilAssSelfAssessmentMigrator  $migrator,
int  $questionId 
)

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

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

728  : void
729  {
730  $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
731  $this->getGenericFeedbackContent($questionId, true)
732  ));
733 
734  $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
735  $this->getGenericFeedbackContent($questionId, false)
736  ));
737  }
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
+ Here is the call graph for this function:

◆ saveGenericFeedbackContent()

ilAssQuestionFeedback::saveGenericFeedbackContent ( int  $questionId,
bool  $solutionCompleted,
string  $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.

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

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

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

306  : int
307  {
308  require_once 'Services/RTE/classes/class.ilRTE.php';
309 
310  $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
311 
312  if (strlen($feedbackContent)) {
313  $feedbackContent = $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
314  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
315  }
316 
317  if ($feedbackId != -1) {
318  $this->db->update(
320  array(
321  'feedback' => array('clob', $feedbackContent),
322  'tstamp' => array('integer', time())
323  ),
324  array(
325  'feedback_id' => array('integer', $feedbackId)
326  )
327  );
328  } else {
329  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
330 
331  $this->db->insert($this->getGenericFeedbackTableName(), array(
332  'feedback_id' => array('integer', $feedbackId),
333  'question_fi' => array('integer', $questionId),
334  'correctness' => array('text', (int) $solutionCompleted), // text ?
335  'feedback' => array('clob', $feedbackContent),
336  'tstamp' => array('integer', time())
337  ));
338  }
339 
340  return $feedbackId;
341  }
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
getGenericFeedbackId(int $questionId, bool $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

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

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

190  : void
191  {
192  if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
193  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, (string) $form->getInput('feedback_incomplete'));
194  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, (string) $form->getInput('feedback_complete'));
195  }
196  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
+ Here is the call graph for this function:

◆ saveSpecificAnswerFeedbackContent()

ilAssQuestionFeedback::saveSpecificAnswerFeedbackContent ( int  $questionId,
int  $questionIndex,
int  $answerIndex,
string  $feedbackContent 
)
abstract

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

Referenced by saveGenericFormProperties().

+ Here is the caller graph for this function:

◆ setPageObjectOutputMode()

ilAssQuestionFeedback::setPageObjectOutputMode ( string  $page_obj_output_mode)
final

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

References $page_obj_output_mode.

554  : void
555  {
556  $this->page_obj_output_mode = $page_obj_output_mode;
557  }

◆ syncFeedback()

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

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

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

References syncGenericFeedback(), and syncSpecificFeedback().

421  : void
422  {
423  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
424  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
425  }
syncGenericFeedback(int $originalQuestionId, int $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question ...
syncSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...
+ Here is the call graph for this function:

◆ syncGenericFeedback()

ilAssQuestionFeedback::syncGenericFeedback ( int  $originalQuestionId,
int  $duplicateQuestionId 
)
private

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

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

References getGenericFeedbackTableName().

Referenced by syncFeedback().

430  : void
431  {
432  // delete generic feedback of the original question
433  $this->db->manipulateF(
434  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
435  array('integer'),
436  array($originalQuestionId)
437  );
438 
439  // get generic feedback of the actual (duplicated) question
440  $result = $this->db->queryF(
441  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
442  array('integer'),
443  array($duplicateQuestionId)
444  );
445 
446  // save generic feedback to the original question
447  while ($row = $this->db->fetchAssoc($result)) {
448  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
449 
450  $this->db->insert($this->getGenericFeedbackTableName(), array(
451  'feedback_id' => array('integer', $nextId),
452  'question_fi' => array('integer', $originalQuestionId),
453  'correctness' => array('text', $row['correctness']),
454  'feedback' => array('clob', $row['feedback']),
455  'tstamp' => array('integer', time())
456  ));
457  }
458  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ syncSpecificFeedback()

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

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

Referenced by checkFeedbackParent(), and syncFeedback().

+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilAssQuestionFeedback::$ctrl
protected

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

Referenced by __construct().

◆ $db

ilDBInterface ilAssQuestionFeedback::$db
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilAssQuestionFeedback::$lng
protected

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

Referenced by __construct().

◆ $page_obj_output_mode

string ilAssQuestionFeedback::$page_obj_output_mode = "presentation"
protected

◆ $questionOBJ

assQuestion ilAssQuestionFeedback::$questionOBJ
protected

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

Referenced by __construct().

◆ CSS_CLASS_FEEDBACK_CORRECT

◆ CSS_CLASS_FEEDBACK_WRONG

◆ FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID

const ilAssQuestionFeedback::FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID = 2

id for page object relating to generic complete solution feedback

Definition at line 52 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 47 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'

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


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