ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilAssConfigurableMultiOptionQuestionFeedback Class Reference
+ Inheritance diagram for ilAssConfigurableMultiOptionQuestionFeedback:
+ Collaboration diagram for ilAssConfigurableMultiOptionQuestionFeedback:

Public Member Functions

 completeSpecificFormProperties (ilPropertyFormGUI $form)
 completes a given form object with the specific form properties required by this question type More...
 
 initSpecificFormProperties (ilPropertyFormGUI $form)
 initialises a given form object's specific form properties relating to this question type More...
 
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 saves a given form object's SPECIFIC form properties relating to this question type More...
 
 isSaveableInPageObjectEditingMode ()
 returns the fact that the feedback editing form is saveable in page object editing mode, because this question type has additional feedback settings More...
 
 saveSpecificFeedbackSetting (int $questionId, int $specificFeedbackSetting)
 saves the given specific feedback setting for the given question id to the db. More...
 
- Public Member Functions inherited from ilAssMultiOptionQuestionFeedback
 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...
 
 completeSpecificFormProperties (ilPropertyFormGUI $form)
 completes a given form object with the specific form properties required by this question type More...
 
 initSpecificFormProperties (ilPropertyFormGUI $form)
 initialises a given form object's specific form properties relating to this question type More...
 
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 saves a given form object's SPECIFIC form properties relating to this question type More...
 
 getSpecificAnswerFeedbackContent (int $questionId, int $questionIndex, int $answerIndex)
 
 getAllSpecificAnswerFeedbackContents (int $questionId)
 
 saveSpecificAnswerFeedbackContent (int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
 
 deleteSpecificAnswerFeedbacks (int $questionId, bool $isAdditionalContentEditingModePageObject)
 
 getAnswerOptionsByAnswerIndex ()
 
 getSpecificAnswerFeedbackExportPresentation (int $questionId, int $questionIndex, int $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importSpecificAnswerFeedback (int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
 
 specificAnswerFeedbackExists ()
 
- Public Member Functions inherited from ilAssQuestionFeedback
 __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)
 

Data Fields

const FEEDBACK_SETTING_ALL = 1
 
const FEEDBACK_SETTING_CHECKED = 2
 
const FEEDBACK_SETTING_CORRECT = 3
 
- Data Fields inherited from ilAssMultiOptionQuestionFeedback
const TABLE_NAME_SPECIFIC_FEEDBACK = 'qpl_fb_specific'
 table name for specific feedback More...
 
- Data Fields inherited from ilAssQuestionFeedback
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

 getSpecificQuestionTableName ()
 
 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...
 
 syncSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
- Protected Member Functions inherited from ilAssMultiOptionQuestionFeedback
 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...
 
 syncSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 getSpecificAnswerFeedbackId (int $questionId, int $questionIndex, int $answerIndex)
 
 getSpecificFeedbackContentForFeedbackIds (array $feedback_ids)
 
 isSpecificAnswerFeedbackId (int $feedbackId)
 
 getSpecificFeedbackTableName ()
 
 buildAnswerOptionLabel (int $index, $answer)
 
 getSpecificAnswerFeedbackPageObjectId (int $questionId, int $questionIndex, int $answerIndex)
 returns a useable page object id for specific answer feedback page objects for the given question id and answer index (using the id sequence of non page object specific answer feedback) More...
 
- Protected Member Functions inherited from ilAssQuestionFeedback
 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)
 

Private Member Functions

 syncSpecificFeedbackSetting (int $sourceQuestionId, int $targetQuestionId)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAssQuestionFeedback
static isValidFeedbackPageObjectType (string $feedbackPageObjectType)
 returns the fact whether the given page object type relates to generic or specific feedback page objects More...
 
- Protected Attributes inherited from ilAssQuestionFeedback
assQuestion $questionOBJ
 
ilCtrl $ctrl
 
ilDBInterface $db
 
ilLanguage $lng
 
string $page_obj_output_mode = "presentation"
 

Detailed Description

Member Function Documentation

◆ completeSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)

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

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 41 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

41 : void
42 {
43 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
44 $header = new ilFormSectionHeaderGUI();
45 $header->setTitle($this->lng->txt('feedback_answers'));
46 $form->addItem($header);
47
48 require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
49 require_once './Services/Form/classes/class.ilRadioOption.php';
50
51 $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
52 $feedback->addOption(
53 new ilRadioOption($this->lng->txt('feedback_all'), self::FEEDBACK_SETTING_ALL)
54 );
55 $feedback->addOption(
56 new ilRadioOption($this->lng->txt('feedback_checked'), self::FEEDBACK_SETTING_CHECKED)
57 );
58 $feedback->addOption(
59 new ilRadioOption($this->lng->txt($this->questionOBJ->getSpecificFeedbackAllCorrectOptionLabel()), self::FEEDBACK_SETTING_CORRECT)
60 );
61
62 $feedback->setRequired(true);
63 $form->addItem($feedback);
64
65 foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
66 $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
67 $this->buildAnswerOptionLabel($index, $answer),
68 true
69 );
70
71 $propertyPostVar = "feedback_answer_$index";
72
74 $propertyLabel,
75 $propertyPostVar,
76 $this->questionOBJ->isAdditionalContentEditingModePageObject()
77 ));
78 }
79 }
80 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$index
Definition: metadata.php:145

References $index, ilPropertyFormGUI\addItem(), ilAssMultiOptionQuestionFeedback\buildAnswerOptionLabel(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ duplicateSpecificFeedback()

ilAssConfigurableMultiOptionQuestionFeedback::duplicateSpecificFeedback ( int  $originalQuestionId,
int  $duplicateQuestionId 
)
protected

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

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 153 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

153 : void
154 {
155 $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
156 parent::duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
157 }

References syncSpecificFeedbackSetting().

+ Here is the call graph for this function:

◆ getSpecificQuestionTableName()

ilAssConfigurableMultiOptionQuestionFeedback::getSpecificQuestionTableName ( )
abstractprotected

Reimplemented in ilAssKprimChoiceFeedback, ilAssMultipleChoiceFeedback, and ilAssSingleChoiceFeedback.

Referenced by saveSpecificFeedbackSetting(), and syncSpecificFeedbackSetting().

+ Here is the caller graph for this function:

◆ initSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)

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

Reimplemented from ilAssMultiOptionQuestionFeedback.

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

82 : void
83 {
84 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
85 $form->getItemByPostVar('feedback_setting')->setValue(
86 $this->questionOBJ->getSpecificFeedbackSetting()
87 );
88
89 foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
90 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
93 $this->getSpecificAnswerFeedbackPageObjectId($this->questionOBJ->getId(), 0, $index)
94 );
95 } else {
96 $value = $this->questionOBJ->prepareTextareaOutput(
97 $this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), 0, $index)
98 );
99 }
100
101 $form->getItemByPostVar("feedback_answer_$index")->setValue($value);
102 }
103 }
104 }
getSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex)
getSpecificAnswerFeedbackPageObjectId(int $questionId, int $questionIndex, int $answerIndex)
returns a useable page object id for specific answer feedback page objects for the given question id ...
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 $index, ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getItemByPostVar(), ilAssQuestionFeedback\getPageObjectNonEditableValueHTML(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackContent(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackPageObjectId(), and ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType().

+ Here is the call graph for this function:

◆ isSaveableInPageObjectEditingMode()

ilAssConfigurableMultiOptionQuestionFeedback::isSaveableInPageObjectEditingMode ( )

returns the fact that the feedback editing form is saveable in page object editing mode, because this question type has additional feedback settings

Reimplemented from ilAssQuestionFeedback.

Definition at line 135 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

135 : bool
136 {
137 return true;
138 }

◆ saveSpecificFeedbackSetting()

ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFeedbackSetting ( int  $questionId,
int  $specificFeedbackSetting 
)

saves the given specific feedback setting for the given question id to the db.

(It::s stored to dataset of question itself)

Definition at line 144 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

144 : void
145 {
146 $this->db->update(
148 array('feedback_setting' => array('integer', $specificFeedbackSetting)),
149 array('question_fi' => array('integer', $questionId))
150 );
151 }

References getSpecificQuestionTableName().

Referenced by saveSpecificFormProperties().

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

◆ saveSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)

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

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 106 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

106 : void
107 {
108 $feedback_setting = $form->getInput('feedback_setting');
109
110 /* sk 03.03.2023: This avoids Problems with questions in Learning Module
111 * See: https://mantis.ilias.de/view.php?id=34724
112 */
113 if ($feedback_setting === '') {
114 return;
115 }
116
117 $this->saveSpecificFeedbackSetting($this->questionOBJ->getId(), (int) $feedback_setting);
118
119 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
120 foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
122 $this->questionOBJ->getId(),
123 0,
124 $index,
125 (string) ($form->getInput("feedback_answer_$index") ?? '')
126 );
127 }
128 }
129 }
saveSpecificFeedbackSetting(int $questionId, int $specificFeedbackSetting)
saves the given specific feedback setting for the given question id to the db.
saveSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
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 $index, ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getInput(), ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent(), and saveSpecificFeedbackSetting().

+ Here is the call graph for this function:

◆ syncSpecificFeedback()

ilAssConfigurableMultiOptionQuestionFeedback::syncSpecificFeedback ( int  $originalQuestionId,
int  $duplicateQuestionId 
)
protected

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

Reimplemented from ilAssMultiOptionQuestionFeedback.

Definition at line 159 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

159 : void
160 {
161 $this->syncSpecificFeedbackSetting($duplicateQuestionId, $originalQuestionId);
162 parent::syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
163 }

References syncSpecificFeedbackSetting().

+ Here is the call graph for this function:

◆ syncSpecificFeedbackSetting()

ilAssConfigurableMultiOptionQuestionFeedback::syncSpecificFeedbackSetting ( int  $sourceQuestionId,
int  $targetQuestionId 
)
private

Definition at line 165 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

165 : void
166 {
167 $res = $this->db->queryF(
168 "SELECT feedback_setting FROM {$this->getSpecificQuestionTableName()} WHERE question_fi = %s",
169 array('integer'),
170 array($sourceQuestionId)
171 );
172
173 $row = $this->db->fetchAssoc($res);
174
175 $this->db->update(
177 array( 'feedback_setting' => array('integer', $row['feedback_setting']) ),
178 array( 'question_fi' => array('integer', $targetQuestionId) )
179 );
180 }
$res
Definition: ltiservices.php:69

References $res, and getSpecificQuestionTableName().

Referenced by duplicateSpecificFeedback(), and syncSpecificFeedback().

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

Field Documentation

◆ FEEDBACK_SETTING_ALL

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_ALL = 1

◆ FEEDBACK_SETTING_CHECKED

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_CHECKED = 2

◆ FEEDBACK_SETTING_CORRECT

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_CORRECT = 3

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