ILIAS  release_8 Revision v8.24
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

@final @access 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.

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...
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
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.

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

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

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

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)

References isGenericFeedbackId(), and isSpecificAnswerFeedbackId().

+ Here is the call graph for this function:

◆ cleanupPageContent()

ilAssQuestionFeedback::cleanupPageContent ( string  $content)
protected

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

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 }

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

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

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

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

+ Here is the call graph for this function:

◆ completeSpecificFormProperties()

ilAssQuestionFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

@abstract @access public

Parameters
ilPropertyFormGUI$form

Reimplemented in ilAssClozeTestFeedback, ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ createPageObject()

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

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

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)

References getClassNameByType().

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

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

◆ deleteGenericFeedbacks()

ilAssQuestionFeedback::deleteGenericFeedbacks ( 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.

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 }
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
ensurePageObjectDeleted(string $pageObjectType, int $pageObjectId)

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

+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacks()

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

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

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

References duplicateGenericFeedback(), and duplicateSpecificFeedback().

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

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

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

Referenced by duplicateFeedback().

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

◆ duplicatePageObject()

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

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

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 }
ensurePageObjectExists(string $pageObjectType, int $pageObjectId)

References ensurePageObjectExists(), and getClassNameByType().

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

+ 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

Reimplemented in ilAssClozeTestFeedback, ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by duplicateFeedback().

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

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...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
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.

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

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

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

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 }

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

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

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

◆ getAllSpecificAnswerFeedbackContents()

ilAssQuestionFeedback::getAllSpecificAnswerFeedbackContents ( int  $questionId)
abstract

◆ getClassNameByType()

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

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

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 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK.

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

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

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

References $res, and ilRTE\_replaceMediaObjectImageSrc().

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

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

◆ getGenericFeedbackExportPresentation()

ilAssQuestionFeedback::getGenericFeedbackExportPresentation ( 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.

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 }
getGenericFeedbackContent(int $questionId, bool $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getPageObjectXML(string $pageObjectType, int $pageObjectId)

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

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

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 }

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

Referenced by getGenericFeedbackPageObjectId(), and saveGenericFeedbackContent().

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

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 }
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
getGenericFeedbackId(int $questionId, bool $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index.

References getGenericFeedbackId(), and saveGenericFeedbackContent().

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

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

◆ getGenericFeedbackPageObjectType()

ilAssQuestionFeedback::getGenericFeedbackPageObjectType ( )
finalprotected

◆ getGenericFeedbackTableName()

ilAssQuestionFeedback::getGenericFeedbackTableName ( )
finalprotected

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

513 : string
514 {
516 }

References TABLE_NAME_GENERIC_FEEDBACK.

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

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

88 : string
89 {
90 if ($this->page_obj_output_mode == "edit") {
91 return '';
92 }
93 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
94 return $this->cleanupPageContent(
97 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
98 )
99 );
100 }
101 return $this->getGenericFeedbackContent($questionId, $solutionCompleted);
102 }
getPageObjectContent(string $pageObjectType, int $pageObjectId)

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

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

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 }

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

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

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

◆ getPageObjectEditingLink()

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

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

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 }

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

Referenced by getPageObjectNonEditableValueHTML().

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

522 : string
523 {
524 $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
525 $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
526
527 return "$link<br /><br />$content";
528 }
getPageObjectEditingLink(string $pageObjectType, int $pageObjectId)

References getPageObjectContent(), and getPageObjectEditingLink().

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

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

◆ getPageObjectOutputMode()

ilAssQuestionFeedback::getPageObjectOutputMode ( )
final

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

559 : string
560 {
562 }

References $page_obj_output_mode.

Referenced by getPageObjectContent().

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

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 }

References ensurePageObjectExists(), and getClassNameByType().

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

+ 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

◆ 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

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by 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

@abstract @access public

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

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

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

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 }
createPageObject(string $pageObjectType, int $pageObjectId, string $pageObjectContent)

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

+ Here is the call graph for this function:

◆ importSpecificAnswerFeedback()

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

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

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 }
getPageObjectNonEditableValueHTML(string $pageObjectType, int $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
getItemByPostVar(string $a_post_var)

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

+ Here is the call graph for this function:

◆ initSpecificFormProperties()

ilAssQuestionFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

Reimplemented in ilAssClozeTestFeedback, ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ isGenericFeedbackId()

ilAssQuestionFeedback::isGenericFeedbackId ( int  $feedbackId)
protected

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

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 }

Referenced by checkFeedbackParent().

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

Reimplemented in ilAssClozeTestFeedback, and ilAssConfigurableMultiOptionQuestionFeedback.

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

209 : bool
210 {
211 return false;
212 }

◆ isSpecificAnswerFeedbackAvailable()

ilAssQuestionFeedback::isSpecificAnswerFeedbackAvailable ( int  $questionId)

Reimplemented in ilAssClozeTestFeedback.

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

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 }
getSpecificAnswerFeedbackExportPresentation(int $questionId, int $questionIndex, int $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...

References $res, and getSpecificAnswerFeedbackExportPresentation().

+ Here is the call graph for this function:

◆ isSpecificAnswerFeedbackId()

ilAssQuestionFeedback::isSpecificAnswerFeedbackId ( int  $feedbackId)
abstractprotected

Reimplemented in ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by checkFeedbackParent().

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

659 : bool
660 {
661 switch ($feedbackPageObjectType) {
664 return true;
665 }
666
667 return false;
668 }

References PAGE_OBJECT_TYPE_GENERIC_FEEDBACK, and PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK.

Referenced by ilAssQuestionFeedbackPageObjectCommandForwarder\__construct().

+ Here is the caller graph for this function:

◆ migrateContentForLearningModule()

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

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

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 }

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

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

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 }

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

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

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

◆ saveGenericFormProperties()

ilAssQuestionFeedback::saveGenericFormProperties ( ilPropertyFormGUI  $form)
final

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

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

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

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

+ Here is the call graph for this function:

◆ saveSpecificAnswerFeedbackContent()

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

◆ saveSpecificFormProperties()

ilAssQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)
abstract

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

Reimplemented in ilAssClozeTestFeedback, ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

◆ setPageObjectOutputMode()

ilAssQuestionFeedback::setPageObjectOutputMode ( string  $page_obj_output_mode)
final

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

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

References $page_obj_output_mode.

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

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

References syncGenericFeedback(), and syncSpecificFeedback().

+ Here is the call graph for this function:

◆ syncGenericFeedback()

ilAssQuestionFeedback::syncGenericFeedback ( 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.

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 }

References getGenericFeedbackTableName().

Referenced by syncFeedback().

+ 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

Reimplemented in ilAssClozeTestFeedback, ilAssConfigurableMultiOptionQuestionFeedback, ilAssMultiOptionQuestionFeedback, and ilAssSingleOptionQuestionFeedback.

Referenced by 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

const ilAssQuestionFeedback::CSS_CLASS_FEEDBACK_CORRECT = 'ilc_qfeedr_FeedbackRight'

◆ CSS_CLASS_FEEDBACK_WRONG

const ilAssQuestionFeedback::CSS_CLASS_FEEDBACK_WRONG = 'ilc_qfeedw_FeedbackWrong'

◆ 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

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

Referenced by getGenericFeedbackTableName().


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