ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 $question_id, int $question_index, int $answer_index)
 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 $question_id, int $question_index, int $answer_index)
 
 getAllSpecificAnswerFeedbackContents (int $question_id)
 
 getAllSpecificAnswerPageEditorFeedbackContents (int $question_id)
 
 saveSpecificAnswerFeedbackContent (int $question_id, int $question_index, int $answer_index, string $feedback_content)
 
 deleteSpecificAnswerFeedbacks (int $question_id, bool $is_additional_content_editing_mode_page_object)
 
 getAnswerOptionsByAnswerIndex ()
 
 getSpecificAnswerFeedbackExportPresentation (int $question_id, int $question_index, int $answer_index)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importSpecificAnswerFeedback (int $question_id, int $question_index, int $answer_index, string $feedback_content)
 
 specificAnswerFeedbackExists ()
 
- Public Member Functions inherited from ilAssQuestionFeedback
 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
 constructor More...
 
 getGenericFeedbackTestPresentation (int $question_id, bool $solution_completed)
 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 $question_id, int $question_index, int $answer_index)
 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 $question_id, bool $solution_completed)
 returns the GENERIC feedback content for a given question state. More...
 
 getSpecificAnswerFeedbackContent (int $question_id, int $question_index, int $answer_index)
 
 getAllSpecificAnswerFeedbackContents (int $question_id)
 
 isSpecificAnswerFeedbackAvailable (int $question_id)
 
 saveGenericFeedbackContent (int $question_id, bool $solution_completed, string $feedback_content)
 saves GENERIC feedback content for the given question id to the database. More...
 
 saveSpecificAnswerFeedbackContent (int $question_id, int $question_index, int $answer_index, string $feedback_content)
 
 deleteGenericFeedbacks (int $question_id, bool $isAdditionalContentEditingModePageObject)
 deletes all GENERIC feedback contents (and page objects if required) for the given question id More...
 
 deleteSpecificAnswerFeedbacks (int $question_id, 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...
 
 cloneFeedback (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 $question_id, bool $solution_completed)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 getSpecificAnswerFeedbackExportPresentation (int $question_id, int $question_index, int $answer_index)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importGenericFeedback (int $question_id, bool $solution_completed, string $feedback_content)
 imports the given feedback content as generic feedback for the given question id for either the complete or incomplete solution More...
 
 importSpecificAnswerFeedback (int $question_id, int $question_index, int $answer_index, string $feedback_content)
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator, int $question_id)
 
 createFeedbackPages (string $mode)
 

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 ()
 
 cloneSpecificFeedback (int $source_question_id, int $target_question_id)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
- Protected Member Functions inherited from ilAssMultiOptionQuestionFeedback
 cloneSpecificFeedback (int $source_question_id, int $target_question_id)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 getSpecificAnswerFeedbackId (int $question_id, int $question_index, int $answer_index)
 
 getSpecificFeedbackContentForFeedbackIds (array $feedback_ids)
 
 isSpecificAnswerFeedbackId (int $feedback_id)
 
 getSpecificFeedbackTableName ()
 
 buildAnswerOptionLabel (int $index, $answer)
 
 getSpecificAnswerFeedbackPageObjectId (int $question_id, int $question_index, int $answer_index)
 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 $post_var, bool $as_non_editable)
 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...
 
 cloneSpecificFeedback (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 $question_id, bool $solution_completed)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 isGenericFeedbackId (int $feedbackId)
 
 isSpecificAnswerFeedbackId (int $feedbackId)
 
 getGenericFeedbackTableName ()
 
 getPageObjectNonEditableValueHTML (string $page_object_type, int $page_object_id)
 returns html content to be used as value for non editable value form properties in feedback editing form More...
 
 getPageObjectXML (string $page_object_type, int $page_object_id)
 
 createPageObject (string $page_object_type, int $page_object_id, string $page_object_content)
 
 clonePageObject (string $page_object_type, int $source_page_object_id, int $target_page_object_id, int $target_page_object_parent_id)
 
 ensurePageObjectDeleted (string $page_object_type, int $page_object_id)
 
 getGenericFeedbackPageObjectType ()
 
 getSpecificAnswerFeedbackPageObjectType ()
 
 getGenericFeedbackPageObjectId (int $question_id, bool $solution_completed)
 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

 cloneSpecificFeedbackSetting (int $source_question_id, int $target_question_id)
 

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

◆ cloneSpecificFeedback()

ilAssConfigurableMultiOptionQuestionFeedback::cloneSpecificFeedback ( 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 148 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

148 : void
149 {
150 $this->cloneSpecificFeedbackSetting($source_question_id, $target_question_id);
151 parent::cloneSpecificFeedback($source_question_id, $target_question_id);
152 }
cloneSpecificFeedbackSetting(int $source_question_id, int $target_question_id)

References cloneSpecificFeedbackSetting().

+ Here is the call graph for this function:

◆ cloneSpecificFeedbackSetting()

ilAssConfigurableMultiOptionQuestionFeedback::cloneSpecificFeedbackSetting ( int  $source_question_id,
int  $target_question_id 
)
private

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

154 : void
155 {
156 $res = $this->db->queryF(
157 "SELECT feedback_setting FROM {$this->getSpecificQuestionTableName()} WHERE question_fi = %s",
158 ['integer'],
159 [$source_question_id]
160 );
161
162 $row = $this->db->fetchAssoc($res);
163
164 if ($this->db->numRows($res) < 1) {
165 return;
166 }
167
168 $this->db->update(
170 [ 'feedback_setting' => ['integer', $row['feedback_setting']] ],
171 [ 'question_fi' => ['integer', $target_question_id] ]
172 );
173 }
$res
Definition: ltiservices.php:69

References $res, and getSpecificQuestionTableName().

Referenced by cloneSpecificFeedback().

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

◆ 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 39 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

39 : void
40 {
41 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
42 $header = new ilFormSectionHeaderGUI();
43 $header->setTitle($this->lng->txt('feedback_answers'));
44 $form->addItem($header);
45
46 $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
47 $feedback->addOption(
48 new ilRadioOption($this->lng->txt('feedback_all'), self::FEEDBACK_SETTING_ALL)
49 );
50 $feedback->addOption(
51 new ilRadioOption($this->lng->txt('feedback_checked'), self::FEEDBACK_SETTING_CHECKED)
52 );
53 $feedback->addOption(
54 new ilRadioOption($this->lng->txt($this->questionOBJ->getSpecificFeedbackAllCorrectOptionLabel()), self::FEEDBACK_SETTING_CORRECT)
55 );
56
57 $feedback->setRequired(true);
58 $form->addItem($feedback);
59
60 foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
62 $this->buildAnswerOptionLabel($index, $answer),
63 true
64 );
65
66 $propertyPostVar = "feedback_answer_$index";
67
69 $propertyLabel,
70 $propertyPostVar,
71 $this->questionOBJ->isAdditionalContentEditingModePageObject()
72 ));
73 }
74 }
75 }
buildFeedbackContentFormProperty(string $label, string $post_var, bool $as_non_editable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
This class represents a section header in a property form.
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free,...
This class represents a property in a property form.
This class represents an option in a radio group.

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

+ Here is the call graph for this function:

◆ getSpecificQuestionTableName()

ilAssConfigurableMultiOptionQuestionFeedback::getSpecificQuestionTableName ( )
abstractprotected

Reimplemented in ilAssKprimChoiceFeedback, ilAssMultipleChoiceFeedback, and ilAssSingleChoiceFeedback.

Referenced by cloneSpecificFeedbackSetting(), and saveSpecificFeedbackSetting().

+ 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 77 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

77 : void
78 {
79 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
80 $form->getItemByPostVar('feedback_setting')->setValue(
81 $this->questionOBJ->getSpecificFeedbackSetting()
82 );
83
84 foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
85 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
88 $this->getSpecificAnswerFeedbackPageObjectId($this->questionOBJ->getId(), 0, $index)
89 );
90 } else {
92 $this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), 0, $index)
93 );
94 }
95
96 $form->getItemByPostVar("feedback_answer_$index")->setValue($value);
97 }
98 }
99 }
getSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index)
getSpecificAnswerFeedbackPageObjectId(int $question_id, int $question_index, int $answer_index)
returns a useable page object id for specific answer feedback page objects for the given question id ...
getPageObjectNonEditableValueHTML(string $page_object_type, int $page_object_id)
returns html content to be used as value for non editable value form properties in feedback editing f...
getItemByPostVar(string $a_post_var)

References ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getItemByPostVar(), ilAssQuestionFeedback\getPageObjectNonEditableValueHTML(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackContent(), ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackPageObjectId(), ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

+ 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 130 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

130 : bool
131 {
132 return true;
133 }

◆ 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 139 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

139 : void
140 {
141 $this->db->update(
143 ['feedback_setting' => ['integer', $specificFeedbackSetting]],
144 ['question_fi' => ['integer', $questionId]]
145 );
146 }

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 101 of file class.ilAssConfigurableMultiOptionQuestionFeedback.php.

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

+ Here is the call 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: