ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ilAssClozeTestFeedback Class Reference
+ Inheritance diagram for ilAssClozeTestFeedback:
+ Collaboration diagram for ilAssClozeTestFeedback:

Public Member Functions

 isSaveableInPageObjectEditingMode ()
 
 completeSpecificFormProperties (ilPropertyFormGUI $form)
 
 initSpecificFormProperties (ilPropertyFormGUI $form)
 
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 
 isSpecificAnswerFeedbackAvailable (int $question_id)
 
 determineTestOutputGapFeedback (int $gap_index, int $answer_index)
 
 determineAnswerIndexForAnswerValue (assClozeGap $gap, string $answerValue)
 
- 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)
 
 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)
 
 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...
 
 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 $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)
 

Data Fields

const FB_MODE_GAP_QUESTION = 'gapQuestion'
 constants for different feedback modes (per gap or per gap-answers/options) More...
 
const FB_MODE_GAP_ANSWERS = 'gapAnswers'
 
const FB_TEXT_GAP_EMPTY_INDEX = -1
 constants for answer indexes in case of FB_MODE_GAP_ANSWERS More...
 
const FB_TEXT_GAP_NOMATCH_INDEX = -2
 
const FB_SELECT_GAP_EMPTY_INDEX = -1
 
const FB_NUMERIC_GAP_EMPTY_INDEX = -1
 
const FB_NUMERIC_GAP_VALUE_HIT_INDEX = 0
 
const FB_NUMERIC_GAP_RANGE_HIT_INDEX = 1
 
const FB_NUMERIC_GAP_TOO_LOW_INDEX = 2
 
const FB_NUMERIC_GAP_TOO_HIGH_INDEX = 3
 
const SINGLE_GAP_FB_ANSWER_INDEX = -10
 
- 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

 buildGapFeedbackLabel (int $gapIndex, assClozeGap $gap)
 builds an answer option label from given (mixed type) index and answer (overwrites parent method from ilAssMultiOptionQuestionFeedback) More...
 
 buildTextGapGivenAnswerFeedbackLabel (int $gapIndex, assAnswerCloze $item)
 
 buildTextGapWrongAnswerFeedbackLabel (int $gapIndex)
 
 buildTextGapEmptyFeedbackLabel (int $gapIndex)
 
 buildSelectGapOptionFeedbackLabel (int $gapIndex, assAnswerCloze $item)
 
 buildSelectGapEmptyFeedbackLabel (int $gapIndex)
 
 buildNumericGapValueHitFeedbackLabel (int $gapIndex)
 
 buildNumericGapRangeHitFeedbackLabel (int $gapIndex)
 
 buildNumericGapTooLowFeedbackLabel (int $gapIndex)
 
 buildNumericGapTooHighFeedbackLabel (int $gapIndex)
 
 buildNumericGapEmptyFeedbackLabel (int $gapIndex)
 
 completeFormPropsForFeedbackModeGapQuestion (ilRadioOption $fbModeOpt)
 
 completeFormPropsForFeedbackModeGapAnswers (ilRadioOption $fbModeOpt)
 
 completeFbPropsForTextGap (ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
 
 completeFbPropsForSelectGap (ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
 
 completeFbPropsForNumericGap (ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
 
 initFeedbackFieldsPerGapQuestion (ilPropertyFormGUI $form)
 
 initFeedbackFieldsPerGapAnswers (ilPropertyFormGUI $form)
 
 initFbPropsForTextGap (ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
 
 initFbPropsForSelectGap (ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
 
 initFbPropsForNumericGap (ilPropertyFormGUI $form, int $gapIndex, assClozeGap $gap)
 
 saveFeedbackFieldsPerGapQuestion (ilPropertyFormGUI $form)
 
 saveFeedbackFieldsPerGapAnswers (ilPropertyFormGUI $form)
 
 saveFbPropsForTextGap (ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
 
 saveFbPropsForSelectGap (ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
 
 saveFbPropsForNumericGap (ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
 
 duplicateSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 
 syncSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 
 saveSpecificFeedbackMode (int $questionId, string $feedbackMode)
 saves the given specific feedback mode for the given question id to the db. More...
 
 buildPostVarForFbFieldPerGapQuestion (int $gapIndex)
 
 buildPostVarForFbFieldPerGapAnswers (int $gapIndex, int $answerIndex)
 
 getSpecificAnswerFeedbackFormValue (int $gapIndex, int $answerIndex)
 
 cleanupSpecificAnswerFeedbacks (string $fbMode)
 
 fetchFeedbackIdsForGapQuestionMode ()
 
 fetchFeedbackIdsForGapAnswersMode ()
 
 deleteSpecificAnswerFeedbacksByIds (array $feedbackIds)
 
- Protected Member Functions inherited from ilAssMultiOptionQuestionFeedback
 duplicateSpecificFeedback (int $original_question_id, int $duplicate_question_id)
 
 syncSpecificFeedback (int $original_question_id, int $duplicate_question_id)
 
 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...
 
 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 $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)
 
 syncSpecificFeedback (int $originalQuestionId, int $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 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...
 
 getPageObjectContent (string $page_object_type, int $page_object_id)
 
 getPageObjectXML (string $page_object_type, int $page_object_id)
 
 createPageObject (string $page_object_type, int $page_object_id, string $page_object_content)
 
 duplicatePageObject (string $page_object_type, int $original_page_object_id, int $duplicate_page_object_id, int $duplicate_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

 syncSpecificFeedbackSetting (int $sourceQuestionId, int $targetQuestionId)
 
 randomGroup ()
 

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

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

Member Function Documentation

◆ buildGapFeedbackLabel()

ilAssClozeTestFeedback::buildGapFeedbackLabel ( int  $gapIndex,
assClozeGap  $gap 
)
protected

builds an answer option label from given (mixed type) index and answer (overwrites parent method from ilAssMultiOptionQuestionFeedback)

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

References assClozeGap\getItems(), and ILIAS\Repository\lng().

Referenced by completeFormPropsForFeedbackModeGapQuestion().

60  : string
61  {
62  $answers = [];
63 
64  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $item) {
65  $answers[] = '"' . $item->getAnswertext() . '"';
66  }
67 
68  $answers = implode(' / ', $answers);
69 
70  return sprintf(
71  $this->lng->txt('ass_cloze_gap_fb_gap_label'),
72  $gapIndex + 1,
73  $answers
74  );
75  }
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNumericGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapEmptyFeedbackLabel ( int  $gapIndex)
protected

Definition at line 130 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForNumericGap().

130  : string
131  {
132  return sprintf($this->lng->txt('ass_cloze_gap_fb_num_empty_label'), $gapIndex + 1);
133  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNumericGapRangeHitFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapRangeHitFeedbackLabel ( int  $gapIndex)
protected

Definition at line 115 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForNumericGap().

115  : string
116  {
117  return sprintf($this->lng->txt('ass_cloze_gap_fb_num_rangehit_label'), $gapIndex + 1);
118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNumericGapTooHighFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapTooHighFeedbackLabel ( int  $gapIndex)
protected

Definition at line 125 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForNumericGap().

125  : string
126  {
127  return sprintf($this->lng->txt('ass_cloze_gap_fb_num_toohigh_label'), $gapIndex + 1);
128  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNumericGapTooLowFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapTooLowFeedbackLabel ( int  $gapIndex)
protected

Definition at line 120 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForNumericGap().

120  : string
121  {
122  return sprintf($this->lng->txt('ass_cloze_gap_fb_num_toolow_label'), $gapIndex + 1);
123  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildNumericGapValueHitFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapValueHitFeedbackLabel ( int  $gapIndex)
protected

Definition at line 110 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForNumericGap().

110  : string
111  {
112  return sprintf($this->lng->txt('ass_cloze_gap_fb_num_valuehit_label'), $gapIndex + 1);
113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPostVarForFbFieldPerGapAnswers()

ilAssClozeTestFeedback::buildPostVarForFbFieldPerGapAnswers ( int  $gapIndex,
int  $answerIndex 
)
protected

Definition at line 685 of file class.ilAssClozeTestFeedback.php.

Referenced by initFbPropsForNumericGap(), initFbPropsForSelectGap(), initFbPropsForTextGap(), saveFbPropsForNumericGap(), saveFbPropsForSelectGap(), and saveFbPropsForTextGap().

685  : string
686  {
687  return "feedback_answer_{$gapIndex}_{$answerIndex}";
688  }
+ Here is the caller graph for this function:

◆ buildPostVarForFbFieldPerGapQuestion()

ilAssClozeTestFeedback::buildPostVarForFbFieldPerGapQuestion ( int  $gapIndex)
protected

Definition at line 680 of file class.ilAssClozeTestFeedback.php.

Referenced by completeFormPropsForFeedbackModeGapQuestion(), initFeedbackFieldsPerGapQuestion(), and saveFeedbackFieldsPerGapQuestion().

680  : string
681  {
682  return "feedback_answer_{$gapIndex}";
683  }
+ Here is the caller graph for this function:

◆ buildSelectGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildSelectGapEmptyFeedbackLabel ( int  $gapIndex)
protected

Definition at line 105 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForSelectGap().

105  : string
106  {
107  return sprintf($this->lng->txt('ass_cloze_gap_fb_sel_empty_label'), $gapIndex + 1);
108  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildSelectGapOptionFeedbackLabel()

ilAssClozeTestFeedback::buildSelectGapOptionFeedbackLabel ( int  $gapIndex,
assAnswerCloze  $item 
)
protected

Definition at line 96 of file class.ilAssClozeTestFeedback.php.

References ASS_AnswerSimple\getAnswertext(), and ILIAS\Repository\lng().

Referenced by completeFbPropsForSelectGap().

96  : string
97  {
98  return sprintf(
99  $this->lng->txt('ass_cloze_gap_fb_sel_opt_label'),
100  $gapIndex + 1,
101  $item->getAnswertext()
102  );
103  }
getAnswertext()
Gets the answer text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTextGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapEmptyFeedbackLabel ( int  $gapIndex)
protected

Definition at line 91 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForTextGap().

91  : string
92  {
93  return sprintf($this->lng->txt('ass_cloze_gap_fb_txt_empty_label'), $gapIndex + 1);
94  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTextGapGivenAnswerFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapGivenAnswerFeedbackLabel ( int  $gapIndex,
assAnswerCloze  $item 
)
protected

Definition at line 77 of file class.ilAssClozeTestFeedback.php.

References ASS_AnswerSimple\getAnswertext(), and ILIAS\Repository\lng().

Referenced by completeFbPropsForTextGap().

77  : string
78  {
79  return sprintf(
80  $this->lng->txt('ass_cloze_gap_fb_txt_match_label'),
81  $gapIndex + 1,
82  $item->getAnswertext()
83  );
84  }
getAnswertext()
Gets the answer text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildTextGapWrongAnswerFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapWrongAnswerFeedbackLabel ( int  $gapIndex)
protected

Definition at line 86 of file class.ilAssClozeTestFeedback.php.

References ILIAS\Repository\lng().

Referenced by completeFbPropsForTextGap().

86  : string
87  {
88  return sprintf($this->lng->txt('ass_cloze_gap_fb_txt_nomatch_label'), $gapIndex + 1);
89  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanupSpecificAnswerFeedbacks()

ilAssClozeTestFeedback::cleanupSpecificAnswerFeedbacks ( string  $fbMode)
protected

Definition at line 712 of file class.ilAssClozeTestFeedback.php.

References deleteSpecificAnswerFeedbacksByIds(), fetchFeedbackIdsForGapAnswersMode(), and fetchFeedbackIdsForGapQuestionMode().

Referenced by saveSpecificFormProperties().

712  : void
713  {
714  switch ($fbMode) {
715  case self::FB_MODE_GAP_QUESTION:
716  $feedbackIds = $this->fetchFeedbackIdsForGapQuestionMode();
717  break;
718 
719  case self::FB_MODE_GAP_ANSWERS:
720  $feedbackIds = $this->fetchFeedbackIdsForGapAnswersMode();
721  break;
722 
723  default: $feedbackIds = [];
724  }
725 
726  $this->deleteSpecificAnswerFeedbacksByIds($feedbackIds);
727  }
deleteSpecificAnswerFeedbacksByIds(array $feedbackIds)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForNumericGap()

ilAssClozeTestFeedback::completeFbPropsForNumericGap ( ilRadioOption  $fbModeOpt,
assClozeGap  $gap,
int  $gapIndex 
)
protected
Parameters
ilRadioOption$fbModeOpt
assClozeGap$gap
integer$gapIndex

Definition at line 287 of file class.ilAssClozeTestFeedback.php.

References ilRadioOption\addSubItem(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), buildNumericGapEmptyFeedbackLabel(), buildNumericGapRangeHitFeedbackLabel(), buildNumericGapTooHighFeedbackLabel(), buildNumericGapTooLowFeedbackLabel(), buildNumericGapValueHitFeedbackLabel(), assClozeGap\numericRangeExists(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

Referenced by completeFormPropsForFeedbackModeGapAnswers().

287  : void
288  {
290  $this->buildNumericGapValueHitFeedbackLabel($gapIndex),
291  true
292  );
293 
294  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
295 
296  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
297  $propertyLabel,
298  $propertyPostVar,
299  $this->questionOBJ->isAdditionalContentEditingModePageObject()
300  ));
301 
302  if ($gap->numericRangeExists()) {
304  $this->buildNumericGapRangeHitFeedbackLabel($gapIndex),
305  true
306  );
307 
308  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_RANGE_HIT_INDEX;
309 
310  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
311  $propertyLabel,
312  $propertyPostVar,
313  $this->questionOBJ->isAdditionalContentEditingModePageObject()
314  ));
315  }
316 
318  $this->buildNumericGapTooLowFeedbackLabel($gapIndex),
319  true
320  );
321 
322  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_TOO_LOW_INDEX;
323 
324  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
325  $propertyLabel,
326  $propertyPostVar,
327  $this->questionOBJ->isAdditionalContentEditingModePageObject()
328  ));
329 
331  $this->buildNumericGapTooHighFeedbackLabel($gapIndex),
332  true
333  );
334 
335  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_TOO_HIGH_INDEX;
336 
337  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
338  $propertyLabel,
339  $propertyPostVar,
340  $this->questionOBJ->isAdditionalContentEditingModePageObject()
341  ));
342 
344  $this->buildNumericGapEmptyFeedbackLabel($gapIndex),
345  true
346  );
347 
348  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_EMPTY_INDEX;
349 
350  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
351  $propertyLabel,
352  $propertyPostVar,
353  $this->questionOBJ->isAdditionalContentEditingModePageObject()
354  ));
355  }
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...
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForSelectGap()

ilAssClozeTestFeedback::completeFbPropsForSelectGap ( ilRadioOption  $fbModeOpt,
assClozeGap  $gap,
int  $gapIndex 
)
protected

Definition at line 251 of file class.ilAssClozeTestFeedback.php.

References ilRadioOption\addSubItem(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), buildSelectGapEmptyFeedbackLabel(), buildSelectGapOptionFeedbackLabel(), assClozeGap\getItems(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

Referenced by completeFormPropsForFeedbackModeGapAnswers().

251  : void
252  {
253  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $optIndex => $item) {
255  $this->buildSelectGapOptionFeedbackLabel($gapIndex, $item),
256  true
257  );
258 
259  $propertyPostVar = "feedback_answer_{$gapIndex}_{$optIndex}";
260 
261  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
262  $propertyLabel,
263  $propertyPostVar,
264  $this->questionOBJ->isAdditionalContentEditingModePageObject()
265  ));
266  }
267 
269  $this->buildSelectGapEmptyFeedbackLabel($gapIndex),
270  true
271  );
272 
273  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_SELECT_GAP_EMPTY_INDEX;
274 
275  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
276  $propertyLabel,
277  $propertyPostVar,
278  $this->questionOBJ->isAdditionalContentEditingModePageObject()
279  ));
280  }
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
buildSelectGapOptionFeedbackLabel(int $gapIndex, assAnswerCloze $item)
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...
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForTextGap()

ilAssClozeTestFeedback::completeFbPropsForTextGap ( ilRadioOption  $fbModeOpt,
assClozeGap  $gap,
int  $gapIndex 
)
protected

Definition at line 207 of file class.ilAssClozeTestFeedback.php.

References ilRadioOption\addSubItem(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), buildTextGapEmptyFeedbackLabel(), buildTextGapGivenAnswerFeedbackLabel(), buildTextGapWrongAnswerFeedbackLabel(), assClozeGap\getItems(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

Referenced by completeFormPropsForFeedbackModeGapAnswers().

207  : void
208  {
209  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $answerIndex => $item) {
211  $this->buildTextGapGivenAnswerFeedbackLabel($gapIndex, $item),
212  true
213  );
214 
215  $propertyPostVar = "feedback_answer_{$gapIndex}_{$answerIndex}";
216 
217  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
218  $propertyLabel,
219  $propertyPostVar,
220  $this->questionOBJ->isAdditionalContentEditingModePageObject()
221  ));
222  }
223 
225  $this->buildTextGapWrongAnswerFeedbackLabel($gapIndex),
226  true
227  );
228 
229  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_TEXT_GAP_NOMATCH_INDEX;
230 
231  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
232  $propertyLabel,
233  $propertyPostVar,
234  $this->questionOBJ->isAdditionalContentEditingModePageObject()
235  ));
236 
238  $this->buildTextGapEmptyFeedbackLabel($gapIndex),
239  true
240  );
241 
242  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_TEXT_GAP_EMPTY_INDEX;
243 
244  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
245  $propertyLabel,
246  $propertyPostVar,
247  $this->questionOBJ->isAdditionalContentEditingModePageObject()
248  ));
249  }
buildTextGapWrongAnswerFeedbackLabel(int $gapIndex)
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
buildTextGapGivenAnswerFeedbackLabel(int $gapIndex, assAnswerCloze $item)
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...
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFormPropsForFeedbackModeGapAnswers()

ilAssClozeTestFeedback::completeFormPropsForFeedbackModeGapAnswers ( ilRadioOption  $fbModeOpt)
protected

Definition at line 185 of file class.ilAssClozeTestFeedback.php.

References completeFbPropsForNumericGap(), completeFbPropsForSelectGap(), completeFbPropsForTextGap(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.

Referenced by completeSpecificFormProperties().

185  : void
186  {
187  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
188  switch ($gap->getType()) {
190 
191  $this->completeFbPropsForTextGap($fbModeOpt, $gap, $gapIndex);
192  break;
193 
195 
196  $this->completeFbPropsForSelectGap($fbModeOpt, $gap, $gapIndex);
197  break;
198 
200 
201  $this->completeFbPropsForNumericGap($fbModeOpt, $gap, $gapIndex);
202  break;
203  }
204  }
205  }
completeFbPropsForSelectGap(ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
completeFbPropsForNumericGap(ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
completeFbPropsForTextGap(ilRadioOption $fbModeOpt, assClozeGap $gap, int $gapIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFormPropsForFeedbackModeGapQuestion()

ilAssClozeTestFeedback::completeFormPropsForFeedbackModeGapQuestion ( ilRadioOption  $fbModeOpt)
protected

Definition at line 167 of file class.ilAssClozeTestFeedback.php.

References ilRadioOption\addSubItem(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), buildGapFeedbackLabel(), buildPostVarForFbFieldPerGapQuestion(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

Referenced by completeSpecificFormProperties().

167  : void
168  {
169  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
171  $this->buildGapFeedbackLabel($gapIndex, $gap),
172  true
173  );
174 
175  $fbModeOpt->addSubItem(
177  $propertyLabel,
178  $this->buildPostVarForFbFieldPerGapQuestion($gapIndex),
179  $this->questionOBJ->isAdditionalContentEditingModePageObject()
180  )
181  );
182  }
183  }
buildGapFeedbackLabel(int $gapIndex, assClozeGap $gap)
builds an answer option label from given (mixed type) index and answer (overwrites parent method from...
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...
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeSpecificFormProperties()

ilAssClozeTestFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)

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

References ilPropertyFormGUI\addItem(), completeFormPropsForFeedbackModeGapAnswers(), completeFormPropsForFeedbackModeGapQuestion(), ILIAS\Repository\lng(), and ilFormPropertyGUI\setRequired().

135  : void
136  {
137  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
138  $header = new ilFormSectionHeaderGUI();
139  $header->setTitle($this->lng->txt('feedback_answers'));
140  $form->addItem($header);
141 
142  $feedbackMode = new ilRadioGroupInputGUI(
143  $this->lng->txt('ass_cloze_fb_mode'),
144  'feedback_mode'
145  );
146  $feedbackMode->setRequired(true);
147  $form->addItem($feedbackMode);
148 
149  $fbModeGapQuestion = new ilRadioOption(
150  $this->lng->txt('ass_cloze_fb_mode_gap_qst'),
151  self::FB_MODE_GAP_QUESTION,
152  $this->lng->txt('ass_cloze_fb_mode_gap_qst_info')
153  );
154  $this->completeFormPropsForFeedbackModeGapQuestion($fbModeGapQuestion);
155  $feedbackMode->addOption($fbModeGapQuestion);
156 
157  $fbModeGapAnswers = new ilRadioOption(
158  $this->lng->txt('ass_cloze_fb_mode_gap_answ'),
159  self::FB_MODE_GAP_ANSWERS,
160  $this->lng->txt('ass_cloze_fb_mode_gap_answ_info')
161  );
162  $this->completeFormPropsForFeedbackModeGapAnswers($fbModeGapAnswers);
163  $feedbackMode->addOption($fbModeGapAnswers);
164  }
165  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
completeFormPropsForFeedbackModeGapQuestion(ilRadioOption $fbModeOpt)
completeFormPropsForFeedbackModeGapAnswers(ilRadioOption $fbModeOpt)
This class represents a property in a property form.
setRequired(bool $a_required)
+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacksByIds()

ilAssClozeTestFeedback::deleteSpecificAnswerFeedbacksByIds ( array  $feedbackIds)
protected
Parameters
int[]$feedbackIds

Definition at line 796 of file class.ilAssClozeTestFeedback.php.

References ilAssQuestionFeedback\ensurePageObjectDeleted(), and ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType().

Referenced by cleanupSpecificAnswerFeedbacks().

796  : void
797  {
798  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
799  foreach ($feedbackIds as $fbId) {
801  }
802  }
803 
804  $IN_feedbackIds = $this->db->in('feedback_id', $feedbackIds, false, 'integer');
805  $this->db->manipulate("DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE {$IN_feedbackIds}");
806  }
ensurePageObjectDeleted(string $page_object_type, int $page_object_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineAnswerIndexForAnswerValue()

ilAssClozeTestFeedback::determineAnswerIndexForAnswerValue ( assClozeGap  $gap,
string  $answerValue 
)

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

References assClozeGap\getItem(), assClozeGap\getItems(), assClozeGap\getType(), randomGroup(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.

821  : int
822  {
823  switch ($gap->getType()) {
825  if ($answerValue === '') {
826  return self::FB_TEXT_GAP_EMPTY_INDEX;
827  }
828 
829  $items = $gap->getItems($this->randomGroup()->dontShuffle());
830 
831  foreach ($items as $answerIndex => $answer) {
832  /* @var assAnswerCloze $answer */
833 
834  if ($answer->getAnswertext() == $answerValue) {
835  return $answerIndex;
836  }
837  }
838 
839  return self::FB_TEXT_GAP_NOMATCH_INDEX;
840 
842  if ($answerValue !== '') {
843  return $answerValue;
844  }
845 
846  return self::FB_SELECT_GAP_EMPTY_INDEX;
847 
848  default:
850  if ($answerValue === '') {
851  return self::FB_NUMERIC_GAP_EMPTY_INDEX;
852  }
853 
854  /* @var assAnswerCloze $item */
855 
856  $item = current($gap->getItems($this->randomGroup()->dontShuffle()));
857 
858  if ($answerValue == $item->getAnswertext()) {
859  return self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
860  }
861 
862  $math = new EvalMath();
863 
864  $item = $gap->getItem(0);
865  $lowerBound = $math->evaluate($item->getLowerBound());
866  $upperBound = $math->evaluate($item->getUpperBound());
867  $preciseValue = $math->evaluate($item->getAnswertext());
868 
869  $solutionValue = $math->evaluate($answerValue);
870 
871  if ($solutionValue == $preciseValue) {
872  return self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
873  } elseif ($solutionValue >= $lowerBound && $solutionValue <= $upperBound) {
874  return self::FB_NUMERIC_GAP_RANGE_HIT_INDEX;
875  } elseif ($solutionValue < $lowerBound) {
876  return self::FB_NUMERIC_GAP_TOO_LOW_INDEX;
877  }
878 
879  // if ($solutionValue > $upperBound) {
880  return self::FB_NUMERIC_GAP_TOO_HIGH_INDEX;
881  //}
882  }
883  }
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
getItem($a_index)
Gets the item with a given index.
+ Here is the call graph for this function:

◆ determineTestOutputGapFeedback()

ilAssClozeTestFeedback::determineTestOutputGapFeedback ( int  $gap_index,
int  $answer_index 
)

Definition at line 808 of file class.ilAssClozeTestFeedback.php.

References ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackTestPresentation().

808  : string
809  {
810  if ($this->questionOBJ->getFeedbackMode() === self::FB_MODE_GAP_QUESTION) {
812  $this->questionOBJ->getId(),
813  $gap_index,
814  self::SINGLE_GAP_FB_ANSWER_INDEX
815  );
816  }
817 
818  return $this->getSpecificAnswerFeedbackTestPresentation($this->questionOBJ->getId(), $gap_index, $answer_index);
819  }
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 presentatio...
+ Here is the call graph for this function:

◆ duplicateSpecificFeedback()

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

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

References syncSpecificFeedbackSetting().

635  : void
636  {
637  $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
638 
639  parent::duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
640  }
syncSpecificFeedbackSetting(int $sourceQuestionId, int $targetQuestionId)
+ Here is the call graph for this function:

◆ fetchFeedbackIdsForGapAnswersMode()

ilAssClozeTestFeedback::fetchFeedbackIdsForGapAnswersMode ( )
protected
Returns
int[]

Definition at line 753 of file class.ilAssClozeTestFeedback.php.

Referenced by cleanupSpecificAnswerFeedbacks(), and isSpecificAnswerFeedbackAvailable().

753  : array
754  {
755  $feedbackIdentifiers = new ilAssSpecificFeedbackIdentifierList();
756  $feedbackIdentifiers->load($this->questionOBJ->getId());
757 
758  $feedbackIds = [];
759 
760  foreach ($feedbackIdentifiers as $identifier) {
761  if ($identifier->getAnswerIndex() == self::SINGLE_GAP_FB_ANSWER_INDEX) {
762  continue;
763  }
764 
765  $feedbackIds[] = $identifier->getFeedbackId();
766  }
767 
768  return $feedbackIds;
769  }
+ Here is the caller graph for this function:

◆ fetchFeedbackIdsForGapQuestionMode()

ilAssClozeTestFeedback::fetchFeedbackIdsForGapQuestionMode ( )
protected
Returns
int[]

Definition at line 732 of file class.ilAssClozeTestFeedback.php.

Referenced by cleanupSpecificAnswerFeedbacks(), and isSpecificAnswerFeedbackAvailable().

732  : array
733  {
734  $feedbackIdentifiers = new ilAssSpecificFeedbackIdentifierList();
735  $feedbackIdentifiers->load($this->questionOBJ->getId());
736 
737  $feedbackIds = [];
738 
739  foreach ($feedbackIdentifiers as $identifier) {
740  if ($identifier->getAnswerIndex() != self::SINGLE_GAP_FB_ANSWER_INDEX) {
741  continue;
742  }
743 
744  $feedbackIds[] = $identifier->getFeedbackId();
745  }
746 
747  return $feedbackIds;
748  }
+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackFormValue()

ilAssClozeTestFeedback::getSpecificAnswerFeedbackFormValue ( int  $gapIndex,
int  $answerIndex 
)
protected

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

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

Referenced by initFbPropsForNumericGap(), initFbPropsForSelectGap(), initFbPropsForTextGap(), and initFeedbackFieldsPerGapQuestion().

690  : string
691  {
692  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
693  $pageObjectId = $this->getSpecificAnswerFeedbackPageObjectId(
694  $this->questionOBJ->getId(),
695  $gapIndex,
696  $answerIndex
697  );
698 
699  $value = $this->getPageObjectNonEditableValueHTML(
701  $pageObjectId
702  );
703  } else {
705  $this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $gapIndex, $answerIndex)
706  );
707  }
708 
709  return $value;
710  }
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 ...
getSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index)
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...
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForNumericGap()

ilAssClozeTestFeedback::initFbPropsForNumericGap ( ilPropertyFormGUI  $form,
int  $gapIndex,
assClozeGap  $gap 
)
protected

Definition at line 443 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), getSpecificAnswerFeedbackFormValue(), and assClozeGap\numericRangeExists().

Referenced by initFeedbackFieldsPerGapAnswers().

443  : void
444  {
445  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
446  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
447  $form->getItemByPostVar($postVar)->setValue($value);
448 
449  if ($gap->numericRangeExists()) {
450  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
451  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
452  $form->getItemByPostVar($postVar)->setValue($value);
453  }
454 
455  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
456  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
457  $form->getItemByPostVar($postVar)->setValue($value);
458 
459  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
460  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
461  $form->getItemByPostVar($postVar)->setValue($value);
462 
463  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
464  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
465  $form->getItemByPostVar($postVar)->setValue($value);
466  }
getItemByPostVar(string $a_post_var)
getSpecificAnswerFeedbackFormValue(int $gapIndex, int $answerIndex)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForSelectGap()

ilAssClozeTestFeedback::initFbPropsForSelectGap ( ilPropertyFormGUI  $form,
assClozeGap  $gap,
int  $gapIndex 
)
protected

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

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), assClozeGap\getItems(), and getSpecificAnswerFeedbackFormValue().

Referenced by initFeedbackFieldsPerGapAnswers().

430  : void
431  {
432  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $optIndex => $item) {
433  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, $optIndex);
434  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $optIndex);
435  $form->getItemByPostVar($postVar)->setValue($value);
436  }
437 
438  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
439  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
440  $form->getItemByPostVar($postVar)->setValue($value);
441  }
getItemByPostVar(string $a_post_var)
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
getSpecificAnswerFeedbackFormValue(int $gapIndex, int $answerIndex)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForTextGap()

ilAssClozeTestFeedback::initFbPropsForTextGap ( ilPropertyFormGUI  $form,
assClozeGap  $gap,
int  $gapIndex 
)
protected

Definition at line 413 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), assClozeGap\getItems(), and getSpecificAnswerFeedbackFormValue().

Referenced by initFeedbackFieldsPerGapAnswers().

413  : void
414  {
415  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $answerIndex => $item) {
416  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex);
417  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex);
418  $form->getItemByPostVar($postVar)->setValue($value);
419  }
420 
421  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
422  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
423  $form->getItemByPostVar($postVar)->setValue($value);
424 
425  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
426  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
427  $form->getItemByPostVar($postVar)->setValue($value);
428  }
getItemByPostVar(string $a_post_var)
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
getSpecificAnswerFeedbackFormValue(int $gapIndex, int $answerIndex)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFeedbackFieldsPerGapAnswers()

ilAssClozeTestFeedback::initFeedbackFieldsPerGapAnswers ( ilPropertyFormGUI  $form)
protected

Definition at line 391 of file class.ilAssClozeTestFeedback.php.

References initFbPropsForNumericGap(), initFbPropsForSelectGap(), initFbPropsForTextGap(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.

Referenced by initSpecificFormProperties().

391  : void
392  {
393  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
394  switch ($gap->getType()) {
396 
397  $this->initFbPropsForTextGap($form, $gap, $gapIndex);
398  break;
399 
401 
402  $this->initFbPropsForSelectGap($form, $gap, $gapIndex);
403  break;
404 
406 
407  $this->initFbPropsForNumericGap($form, $gapIndex, $gap);
408  break;
409  }
410  }
411  }
initFbPropsForSelectGap(ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
initFbPropsForNumericGap(ilPropertyFormGUI $form, int $gapIndex, assClozeGap $gap)
initFbPropsForTextGap(ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFeedbackFieldsPerGapQuestion()

ilAssClozeTestFeedback::initFeedbackFieldsPerGapQuestion ( ilPropertyFormGUI  $form)
protected

Definition at line 383 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapQuestion(), ilPropertyFormGUI\getItemByPostVar(), and getSpecificAnswerFeedbackFormValue().

Referenced by initSpecificFormProperties().

383  : void
384  {
385  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
386  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::SINGLE_GAP_FB_ANSWER_INDEX);
387  $form->getItemByPostVar($this->buildPostVarForFbFieldPerGapQuestion($gapIndex))->setValue($value);
388  }
389  }
getItemByPostVar(string $a_post_var)
getSpecificAnswerFeedbackFormValue(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSpecificFormProperties()

ilAssClozeTestFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)

Definition at line 357 of file class.ilAssClozeTestFeedback.php.

References ilPropertyFormGUI\getItemByPostVar(), initFeedbackFieldsPerGapAnswers(), and initFeedbackFieldsPerGapQuestion().

357  : void
358  {
359  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
360  /* @var ilRadioGroupInputGUI $fbMode */
361  $fbMode = $form->getItemByPostVar('feedback_mode');
362  $fbMode->setValue($this->questionOBJ->getFeedbackMode());
363 
364  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
365  $this->initFeedbackFieldsPerGapQuestion($form);
366  $this->initFeedbackFieldsPerGapAnswers($form);
367  } else {
368  switch ($this->questionOBJ->getFeedbackMode()) {
369  case self::FB_MODE_GAP_QUESTION:
370 
371  $this->initFeedbackFieldsPerGapQuestion($form);
372  break;
373 
374  case self::FB_MODE_GAP_ANSWERS:
375 
376  $this->initFeedbackFieldsPerGapAnswers($form);
377  break;
378  }
379  }
380  }
381  }
initFeedbackFieldsPerGapAnswers(ilPropertyFormGUI $form)
initFeedbackFieldsPerGapQuestion(ilPropertyFormGUI $form)
getItemByPostVar(string $a_post_var)
+ Here is the call graph for this function:

◆ isSaveableInPageObjectEditingMode()

ilAssClozeTestFeedback::isSaveableInPageObjectEditingMode ( )

Definition at line 51 of file class.ilAssClozeTestFeedback.php.

51  : bool
52  {
53  return true;
54  }

◆ isSpecificAnswerFeedbackAvailable()

ilAssClozeTestFeedback::isSpecificAnswerFeedbackAvailable ( int  $question_id)

Definition at line 771 of file class.ilAssClozeTestFeedback.php.

References fetchFeedbackIdsForGapAnswersMode(), fetchFeedbackIdsForGapQuestionMode(), ilAssQuestionFeedback\getPageObjectXML(), ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType(), and ilAssMultiOptionQuestionFeedback\getSpecificFeedbackContentForFeedbackIds().

771  : bool
772  {
773  if ($this->questionOBJ->getFeedbackMode() === self::FB_MODE_GAP_QUESTION) {
774  $feedback_ids = $this->fetchFeedbackIdsForGapQuestionMode();
775  } else {
776  $feedback_ids = $this->fetchFeedbackIdsForGapAnswersMode();
777  }
778 
779  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
780  $all_feedback_content = '';
781  foreach ($feedback_ids as $feedback_id) {
782  $all_feedback_content .= $this->getPageObjectXML(
784  $feedback_id
785  );
786  }
787  return trim(strip_tags($all_feedback_content)) !== '';
788  }
789 
790  return implode('', $this->getSpecificFeedbackContentForFeedbackIds($feedback_ids)) !== '';
791  }
getPageObjectXML(string $page_object_type, int $page_object_id)
+ Here is the call graph for this function:

◆ randomGroup()

ilAssClozeTestFeedback::randomGroup ( )
private

Definition at line 885 of file class.ilAssClozeTestFeedback.php.

References $DIC.

Referenced by determineAnswerIndexForAnswerValue().

885  : RandomGroup
886  {
887  global $DIC;
888 
889  return $DIC->refinery()->random();
890  }
$DIC
Definition: xapitoken.php:62
+ Here is the caller graph for this function:

◆ saveFbPropsForNumericGap()

ilAssClozeTestFeedback::saveFbPropsForNumericGap ( ilPropertyFormGUI  $form,
assClozeGap  $gap,
int  $gapIndex 
)
protected

Definition at line 585 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), assClozeGap\numericRangeExists(), and ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent().

Referenced by saveFeedbackFieldsPerGapAnswers().

585  : void
586  {
587  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
588  $value = $form->getItemByPostVar($postVar)->getValue();
590  $this->questionOBJ->getId(),
591  $gapIndex,
592  self::FB_NUMERIC_GAP_VALUE_HIT_INDEX,
593  $value
594  );
595 
596  if ($gap->numericRangeExists()) {
597  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
598  $value = $form->getItemByPostVar($postVar)->getValue();
600  $this->questionOBJ->getId(),
601  $gapIndex,
602  self::FB_NUMERIC_GAP_RANGE_HIT_INDEX,
603  $value
604  );
605  }
606 
607  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
608  $value = $form->getItemByPostVar($postVar)->getValue();
610  $this->questionOBJ->getId(),
611  $gapIndex,
612  self::FB_NUMERIC_GAP_TOO_LOW_INDEX,
613  $value
614  );
615 
616  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
617  $value = $form->getItemByPostVar($postVar)->getValue();
619  $this->questionOBJ->getId(),
620  $gapIndex,
621  self::FB_NUMERIC_GAP_TOO_HIGH_INDEX,
622  $value
623  );
624 
625  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
626  $value = $form->getItemByPostVar($postVar)->getValue();
628  $this->questionOBJ->getId(),
629  $gapIndex,
630  self::FB_NUMERIC_GAP_EMPTY_INDEX,
631  $value
632  );
633  }
getItemByPostVar(string $a_post_var)
saveSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index, string $feedback_content)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFbPropsForSelectGap()

ilAssClozeTestFeedback::saveFbPropsForSelectGap ( ilPropertyFormGUI  $form,
assClozeGap  $gap,
int  $gapIndex 
)
protected

Definition at line 562 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), assClozeGap\getItems(), and ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent().

Referenced by saveFeedbackFieldsPerGapAnswers().

562  : void
563  {
564  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $optIndex => $item) {
565  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $optIndex);
566  $value = $form->getItemByPostVar($postVar)->getValue();
568  $this->questionOBJ->getId(),
569  $gapIndex,
570  $optIndex,
571  $value
572  );
573  }
574 
575  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
576  $value = $form->getItemByPostVar($postVar)->getValue();
578  $this->questionOBJ->getId(),
579  $gapIndex,
580  self::FB_SELECT_GAP_EMPTY_INDEX,
581  $value
582  );
583  }
getItemByPostVar(string $a_post_var)
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
saveSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index, string $feedback_content)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFbPropsForTextGap()

ilAssClozeTestFeedback::saveFbPropsForTextGap ( ilPropertyFormGUI  $form,
assClozeGap  $gap,
int  $gapIndex 
)
protected

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

References buildPostVarForFbFieldPerGapAnswers(), ilPropertyFormGUI\getItemByPostVar(), assClozeGap\getItems(), and ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent().

Referenced by saveFeedbackFieldsPerGapAnswers().

530  : void
531  {
532  foreach ($gap->getItems($this->randomGroup()->dontShuffle()) as $answerIndex => $item) {
533  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex);
534  $value = $form->getItemByPostVar($postVar)->getValue();
536  $this->questionOBJ->getId(),
537  $gapIndex,
538  $answerIndex,
539  $value
540  );
541  }
542 
543  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
544  $value = $form->getItemByPostVar($postVar)->getValue();
546  $this->questionOBJ->getId(),
547  $gapIndex,
548  self::FB_TEXT_GAP_NOMATCH_INDEX,
549  $value
550  );
551 
552  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
553  $value = $form->getItemByPostVar($postVar)->getValue();
555  $this->questionOBJ->getId(),
556  $gapIndex,
557  self::FB_TEXT_GAP_EMPTY_INDEX,
558  $value
559  );
560  }
getItemByPostVar(string $a_post_var)
getItems(Transformation $shuffler, ?int $gap_index=null)
Gets the items of a cloze gap.
saveSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index, string $feedback_content)
buildPostVarForFbFieldPerGapAnswers(int $gapIndex, int $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFeedbackFieldsPerGapAnswers()

ilAssClozeTestFeedback::saveFeedbackFieldsPerGapAnswers ( ilPropertyFormGUI  $form)
protected

Definition at line 508 of file class.ilAssClozeTestFeedback.php.

References saveFbPropsForNumericGap(), saveFbPropsForSelectGap(), saveFbPropsForTextGap(), assClozeGap\TYPE_NUMERIC, assClozeGap\TYPE_SELECT, and assClozeGap\TYPE_TEXT.

Referenced by saveSpecificFormProperties().

508  : void
509  {
510  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
511  switch ($gap->getType()) {
513 
514  $this->saveFbPropsForTextGap($form, $gap, $gapIndex);
515  break;
516 
518 
519  $this->saveFbPropsForSelectGap($form, $gap, $gapIndex);
520  break;
521 
523 
524  $this->saveFbPropsForNumericGap($form, $gap, $gapIndex);
525  break;
526  }
527  }
528  }
saveFbPropsForSelectGap(ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
saveFbPropsForTextGap(ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
saveFbPropsForNumericGap(ilPropertyFormGUI $form, assClozeGap $gap, int $gapIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFeedbackFieldsPerGapQuestion()

ilAssClozeTestFeedback::saveFeedbackFieldsPerGapQuestion ( ilPropertyFormGUI  $form)
protected

Definition at line 493 of file class.ilAssClozeTestFeedback.php.

References buildPostVarForFbFieldPerGapQuestion(), ilPropertyFormGUI\getItemByPostVar(), and ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent().

Referenced by saveSpecificFormProperties().

493  : void
494  {
495  foreach ($this->questionOBJ->getGaps() as $gapIndex => $gap) {
496  $postVar = $this->buildPostVarForFbFieldPerGapQuestion($gapIndex);
497  $value = $form->getItemByPostVar($postVar)->getValue();
498 
500  $this->questionOBJ->getId(),
501  $gapIndex,
502  self::SINGLE_GAP_FB_ANSWER_INDEX,
503  $value
504  );
505  }
506  }
getItemByPostVar(string $a_post_var)
saveSpecificAnswerFeedbackContent(int $question_id, int $question_index, int $answer_index, string $feedback_content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSpecificFeedbackMode()

ilAssClozeTestFeedback::saveSpecificFeedbackMode ( int  $questionId,
string  $feedbackMode 
)
protected

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

(It's stored to dataset of question itself)

Definition at line 669 of file class.ilAssClozeTestFeedback.php.

Referenced by saveSpecificFormProperties().

669  : void
670  {
671  $this->questionOBJ->setFeedbackMode($feedbackMode);
672 
673  $this->db->update(
674  $this->questionOBJ->getAdditionalTableName(),
675  ['feedback_mode' => ['text', $feedbackMode]],
676  ['question_fi' => ['integer', $questionId]]
677  );
678  }
+ Here is the caller graph for this function:

◆ saveSpecificFormProperties()

ilAssClozeTestFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)

Definition at line 468 of file class.ilAssClozeTestFeedback.php.

References cleanupSpecificAnswerFeedbacks(), ilPropertyFormGUI\getItemByPostVar(), saveFeedbackFieldsPerGapAnswers(), saveFeedbackFieldsPerGapQuestion(), and saveSpecificFeedbackMode().

468  : void
469  {
470  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
471  $fbMode = $form->getItemByPostVar('feedback_mode')->getValue();
472 
473  if ($fbMode != $this->questionOBJ->getFeedbackMode()) {
474  $this->cleanupSpecificAnswerFeedbacks($this->questionOBJ->getFeedbackMode());
475  }
476 
477  $this->saveSpecificFeedbackMode($this->questionOBJ->getId(), $fbMode);
478 
479  switch ($this->questionOBJ->getFeedbackMode()) {
480  case self::FB_MODE_GAP_QUESTION:
481 
482  $this->saveFeedbackFieldsPerGapQuestion($form);
483  break;
484 
485  case self::FB_MODE_GAP_ANSWERS:
486 
487  $this->saveFeedbackFieldsPerGapAnswers($form);
488  break;
489  }
490  }
491  }
getItemByPostVar(string $a_post_var)
saveSpecificFeedbackMode(int $questionId, string $feedbackMode)
saves the given specific feedback mode for the given question id to the db.
saveFeedbackFieldsPerGapQuestion(ilPropertyFormGUI $form)
saveFeedbackFieldsPerGapAnswers(ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ syncSpecificFeedback()

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

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

References syncSpecificFeedbackSetting().

659  : void
660  {
661  $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
662  parent::syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
663  }
syncSpecificFeedbackSetting(int $sourceQuestionId, int $targetQuestionId)
+ Here is the call graph for this function:

◆ syncSpecificFeedbackSetting()

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

Definition at line 642 of file class.ilAssClozeTestFeedback.php.

References $res.

Referenced by duplicateSpecificFeedback(), and syncSpecificFeedback().

642  : void
643  {
644  $res = $this->db->queryF(
645  "SELECT feedback_mode FROM {$this->questionOBJ->getAdditionalTableName()} WHERE question_fi = %s",
646  ['integer'],
647  [$sourceQuestionId]
648  );
649 
650  $row = $this->db->fetchAssoc($res);
651 
652  $this->db->update(
653  $this->questionOBJ->getAdditionalTableName(),
654  [ 'feedback_mode' => ['text', $row['feedback_mode']] ],
655  [ 'question_fi' => ['integer', $targetQuestionId] ]
656  );
657  }
$res
Definition: ltiservices.php:67
+ Here is the caller graph for this function:

Field Documentation

◆ FB_MODE_GAP_ANSWERS

const ilAssClozeTestFeedback::FB_MODE_GAP_ANSWERS = 'gapAnswers'

Definition at line 35 of file class.ilAssClozeTestFeedback.php.

◆ FB_MODE_GAP_QUESTION

const ilAssClozeTestFeedback::FB_MODE_GAP_QUESTION = 'gapQuestion'

constants for different feedback modes (per gap or per gap-answers/options)

Definition at line 34 of file class.ilAssClozeTestFeedback.php.

Referenced by assClozeTestImport\fromXML(), and assClozeTest\loadFromDb().

◆ FB_NUMERIC_GAP_EMPTY_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_EMPTY_INDEX = -1

Definition at line 43 of file class.ilAssClozeTestFeedback.php.

◆ FB_NUMERIC_GAP_RANGE_HIT_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_RANGE_HIT_INDEX = 1

Definition at line 45 of file class.ilAssClozeTestFeedback.php.

◆ FB_NUMERIC_GAP_TOO_HIGH_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_TOO_HIGH_INDEX = 3

Definition at line 47 of file class.ilAssClozeTestFeedback.php.

◆ FB_NUMERIC_GAP_TOO_LOW_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_TOO_LOW_INDEX = 2

Definition at line 46 of file class.ilAssClozeTestFeedback.php.

◆ FB_NUMERIC_GAP_VALUE_HIT_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_VALUE_HIT_INDEX = 0

Definition at line 44 of file class.ilAssClozeTestFeedback.php.

◆ FB_SELECT_GAP_EMPTY_INDEX

const ilAssClozeTestFeedback::FB_SELECT_GAP_EMPTY_INDEX = -1

Definition at line 42 of file class.ilAssClozeTestFeedback.php.

◆ FB_TEXT_GAP_EMPTY_INDEX

const ilAssClozeTestFeedback::FB_TEXT_GAP_EMPTY_INDEX = -1

constants for answer indexes in case of FB_MODE_GAP_ANSWERS

Definition at line 40 of file class.ilAssClozeTestFeedback.php.

◆ FB_TEXT_GAP_NOMATCH_INDEX

const ilAssClozeTestFeedback::FB_TEXT_GAP_NOMATCH_INDEX = -2

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

◆ SINGLE_GAP_FB_ANSWER_INDEX

const ilAssClozeTestFeedback::SINGLE_GAP_FB_ANSWER_INDEX = -10

Definition at line 49 of file class.ilAssClozeTestFeedback.php.


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