ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssClozeTestFeedback Class Reference
+ Inheritance diagram for ilAssClozeTestFeedback:
+ Collaboration diagram for ilAssClozeTestFeedback:

Public Member Functions

 isSaveableInPageObjectEditingMode ()
 
 completeSpecificFormProperties (ilPropertyFormGUI $form)
 
 initSpecificFormProperties (ilPropertyFormGUI $form)
 
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 
 determineTestOutputGapFeedback ($gapIndex, $answerIndex)
 
 determineAnswerIndexForAnswerValue (assClozeGap $gap, $answerValue)
 
- Public Member Functions inherited from ilAssMultiOptionQuestionFeedback
 getSpecificAnswerFeedbackTestPresentation ($questionId, $questionIndex, $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 ($questionId, $questionIndex, $answerIndex)
 returns the SPECIFIC answer feedback content for a given question id and answer index. More...
 
 getAllSpecificAnswerFeedbackContents ($questionId)
 returns the SPECIFIC feedback content for a given question id and answer index. More...
 
 saveSpecificAnswerFeedbackContent ($questionId, $questionIndex, $answerIndex, $feedbackContent)
 saves SPECIFIC answer feedback content for the given question id and answer index to the database. More...
 
 deleteSpecificAnswerFeedbacks ($questionId, $isAdditionalContentEditingModePageObject)
 deletes all SPECIFIC answer feedback contents (and page objects if required) for the given question id More...
 
 getAnswerOptionsByAnswerIndex ()
 returns the answer options mapped by answer index (can be overwritten by concrete question type class) More...
 
 getSpecificAnswerFeedbackExportPresentation ($questionId, $questionIndex, $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importSpecificAnswerFeedback ($questionId, $questionIndex, $answerIndex, $feedbackContent)
 imports the given feedback content as specific feedback for the given question id and answer index More...
 
 specificAnswerFeedbackExists ()
 
- Public Member Functions inherited from ilAssQuestionFeedback
 __construct (assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
 constructor More...
 
 getGenericFeedbackTestPresentation ($questionId, $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 ($questionId, $questionIndex, $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 ($questionId, $solutionCompleted)
 returns the GENERIC feedback content for a given question state. More...
 
 getSpecificAnswerFeedbackContent ($questionId, $questionIndex, $answerIndex)
 returns the SPECIFIC feedback content for a given question id and answer index. More...
 
 getAllSpecificAnswerFeedbackContents ($questionId)
 returns the SPECIFIC feedback content for a given question id and answer index. More...
 
 isSpecificAnswerFeedbackAvailable ($questionId)
 returns the fact wether any specific feedback content is available or not More...
 
 saveGenericFeedbackContent ($questionId, $solutionCompleted, $feedbackContent)
 saves GENERIC feedback content for the given question id to the database. More...
 
 saveSpecificAnswerFeedbackContent ($questionId, $questionIndex, $answerIndex, $feedbackContent)
 saves SPECIFIC feedback content for the given question id and answer index to the database. More...
 
 deleteGenericFeedbacks ($questionId, $isAdditionalContentEditingModePageObject)
 deletes all GENERIC feedback contents (and page objects if required) for the given question id More...
 
 deleteSpecificAnswerFeedbacks ($questionId, $isAdditionalContentEditingModePageObject)
 deletes all SPECIFIC feedback contents for the given question id More...
 
 duplicateFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the feedback from a duplicated question back to the original question More...
 
 checkFeedbackParent ($feedbackId)
 
 getClassNameByType ($a_type, $a_gui=false)
 Get class name by type. More...
 
 setPageObjectOutputMode ($a_val)
 Set page object output mode. More...
 
 getPageObjectOutputMode ()
 Get page object output mode. More...
 
 getGenericFeedbackExportPresentation ($questionId, $solutionCompleted)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 getSpecificAnswerFeedbackExportPresentation ($questionId, $questionIndex, $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importGenericFeedback ($questionId, $solutionCompleted, $feedbackContent)
 imports the given feedback content as generic feedback for the given question id for either the complete or incomplete solution More...
 
 importSpecificAnswerFeedback ($questionId, $questionIndex, $answerIndex, $feedbackContent)
 imports the given feedback content as specific feedback for the given question id and answer index More...
 
 migrateContentForLearningModule (ilAssSelfAssessmentMigrator $migrator, $questionId)
 

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'
 table name for specific feedback More...
 

Protected Member Functions

 getGapsByIndex ()
 returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQuestionFeedback) More...
 
 buildGapFeedbackLabel ($gapIndex, $gap)
 builds an answer option label from given (mixed type) index and answer (overwrites parent method from ilAssMultiOptionQuestionFeedback) More...
 
 buildTextGapGivenAnswerFeedbackLabel ($gapIndex, $item)
 
 buildTextGapWrongAnswerFeedbackLabel ($gapIndex)
 
 buildTextGapEmptyFeedbackLabel ($gapIndex)
 
 buildSelectGapOptionFeedbackLabel ($gapIndex, $item)
 
 buildSelectGapEmptyFeedbackLabel ($gapIndex)
 
 buildNumericGapValueHitFeedbackLabel ($gapIndex)
 
 buildNumericGapRangeHitFeedbackLabel ($gapIndex)
 
 buildNumericGapTooLowFeedbackLabel ($gapIndex)
 
 buildNumericGapTooHighFeedbackLabel ($gapIndex)
 
 buildNumericGapEmptyFeedbackLabel ($gapIndex)
 
 completeFormPropsForFeedbackModeGapQuestion (ilRadioOption $fbModeOpt)
 
 completeFormPropsForFeedbackModeGapAnswers (ilRadioOption $fbModeOpt)
 
 completeFbPropsForTextGap (ilRadioOption $fbModeOpt, assClozeGap $gap, $gapIndex)
 
 completeFbPropsForSelectGap (ilRadioOption $fbModeOpt, assClozeGap $gap, $gapIndex)
 
 completeFbPropsForNumericGap (ilRadioOption $fbModeOpt, $gapIndex, assClozeGap $gap)
 
 initFeedbackFieldsPerGapQuestion (ilPropertyFormGUI $form)
 
 initFeedbackFieldsPerGapAnswers (ilPropertyFormGUI $form)
 
 initFbPropsForTextGap (ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
 
 initFbPropsForSelectGap (ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
 
 initFbPropsForNumericGap (ilPropertyFormGUI $form, $gapIndex, assClozeGap $gap)
 
 saveFeedbackFieldsPerGapQuestion (ilPropertyFormGUI $form)
 
 saveFeedbackFieldsPerGapAnswers (ilPropertyFormGUI $form)
 
 saveFbPropsForTextGap (ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
 
 saveFbPropsForSelectGap (ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
 
 saveFbPropsForNumericGap (ilPropertyFormGUI $form, $gapIndex, assClozeGap $gap)
 
 duplicateSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 
 saveSpecificFeedbackMode ($questionId, $feedbackMode)
 saves the given specific feedback mode for the given question id to the db. More...
 
 buildPostVarForFbFieldPerGapQuestion ($gapIndex)
 
 buildPostVarForFbFieldPerGapAnswers ($gapIndex, $answerIndex)
 
 getSpecificAnswerFeedbackFormValue ($gapIndex, $answerIndex)
 
 cleanupSpecificAnswerFeedbacks ($fbMode)
 
 fetchFeedbackIdsForGapQuestionMode ()
 
 fetchFeedbackIdsForGapAnswersMode ()
 
 deleteSpecificAnswerFeedbacksByIds ($feedbackIds)
 
- Protected Member Functions inherited from ilAssMultiOptionQuestionFeedback
 duplicateSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 getSpecificAnswerFeedbackId ($questionId, $questionIndex, $answerIndex)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 isSpecificAnswerFeedbackId ($feedbackId)
 
 getSpecificFeedbackTableName ()
 returns the table name for specific feedback More...
 
 buildAnswerOptionLabel ($index, $answer)
 builds an answer option label from given (mixed type) index and answer (can be overwritten by concrete question types) More...
 
 getSpecificAnswerFeedbackPageObjectId ($questionId, $questionIndex, $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 ($label, $postVar, $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 ($originalQuestionId, $duplicateQuestionId)
 duplicates the SPECIFIC feedback relating to the given original question id and saves it for the given duplicate question id More...
 
 getGenericFeedbackId ($questionId, $solutionCompleted)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 isGenericFeedbackId ($feedbackId)
 
 isSpecificAnswerFeedbackId ($feedbackId)
 
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
 getGenericFeedbackTableName ()
 returns the table name for specific feedback More...
 
 getPageObjectNonEditableValueHTML ($pageObjectType, $pageObjectId)
 returns html content to be used as value for non editable value form properties in feedback editing form More...
 
 getPageObjectContent ($pageObjectType, $pageObjectId)
 returns the content of page object with given type and id More...
 
 getPageObjectXML ($pageObjectType, $pageObjectId)
 returns the xml of page object with given type and id More...
 
 createPageObject ($pageObjectType, $pageObjectId, $pageObjectContent)
 creates a new page object with given page object id and page object type and passed page object content More...
 
 duplicatePageObject ($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
 duplicates the page object with given type and original id to new page object with same type and given duplicate id and duplicate parent id More...
 
 ensurePageObjectDeleted ($pageObjectType, $pageObjectId)
 ensures a no more existing page object for given type and id More...
 
 getGenericFeedbackPageObjectType ()
 returns the type for generic feedback page objects defined in local constant More...
 
 getSpecificAnswerFeedbackPageObjectType ()
 returns the type for specific feedback page objects defined in local constant More...
 
 getGenericFeedbackPageObjectId ($questionId, $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...
 

Protected Attributes

 $questionOBJ = null
 
- Protected Attributes inherited from ilAssQuestionFeedback
 $questionOBJ = null
 
 $ctrl = null
 
 $db = null
 
 $lng = null
 
 $page_obj_output_mode = "presentation"
 

Private Member Functions

 syncSpecificFeedbackSetting ($sourceQuestionId, $targetQuestionId)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilAssQuestionFeedback
static isValidFeedbackPageObjectType ($feedbackPageObjectType)
 returns the fact wether the given page object type relates to generic or specific feedback page objects More...
 

Detailed Description

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

Member Function Documentation

◆ buildGapFeedbackLabel()

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

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

protected

Parameters
integer$indexgapIndex
assClozeGap$gap
Returns
string $answerOptionLabel

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

References $DIC.

Referenced by completeFormPropsForFeedbackModeGapQuestion().

74  {
75  global $DIC; /* @var ILIAS\DI\Container $DIC */
76 
77  $answers = array();
78 
79  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $item) {
80  $answers[] = '"' . $item->getAnswertext() . '"';
81  }
82 
83  $answers = implode(' / ', $answers);
84 
85  $label = sprintf(
86  $DIC->language()->txt('ass_cloze_gap_fb_gap_label'),
87  $gapIndex + 1,
88  $answers
89  );
90 
91  return $label;
92  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildNumericGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapEmptyFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForNumericGap().

201  {
202  global $DIC; /* @var ILIAS\DI\Container $DIC */
203  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_num_empty_label'), $gapIndex + 1);
204  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildNumericGapRangeHitFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapRangeHitFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForNumericGap().

171  {
172  global $DIC; /* @var ILIAS\DI\Container $DIC */
173  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_num_rangehit_label'), $gapIndex + 1);
174  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildNumericGapTooHighFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapTooHighFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForNumericGap().

191  {
192  global $DIC; /* @var ILIAS\DI\Container $DIC */
193  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_num_toohigh_label'), $gapIndex + 1);
194  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildNumericGapTooLowFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapTooLowFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForNumericGap().

181  {
182  global $DIC; /* @var ILIAS\DI\Container $DIC */
183  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_num_toolow_label'), $gapIndex + 1);
184  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildNumericGapValueHitFeedbackLabel()

ilAssClozeTestFeedback::buildNumericGapValueHitFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForNumericGap().

161  {
162  global $DIC; /* @var ILIAS\DI\Container $DIC */
163  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_num_valuehit_label'), $gapIndex + 1);
164  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildPostVarForFbFieldPerGapAnswers()

ilAssClozeTestFeedback::buildPostVarForFbFieldPerGapAnswers (   $gapIndex,
  $answerIndex 
)
protected
Parameters
integer$gapIndex
integer$answerIndex
Returns
string

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

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

790  {
791  return "feedback_answer_{$gapIndex}_{$answerIndex}";
792  }
+ Here is the caller graph for this function:

◆ buildPostVarForFbFieldPerGapQuestion()

ilAssClozeTestFeedback::buildPostVarForFbFieldPerGapQuestion (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

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

780  {
781  return "feedback_answer_{$gapIndex}";
782  }
+ Here is the caller graph for this function:

◆ buildSelectGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildSelectGapEmptyFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForSelectGap().

151  {
152  global $DIC; /* @var ILIAS\DI\Container $DIC */
153  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_sel_empty_label'), $gapIndex + 1);
154  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildSelectGapOptionFeedbackLabel()

ilAssClozeTestFeedback::buildSelectGapOptionFeedbackLabel (   $gapIndex,
  $item 
)
protected
Parameters
integer$gapIndex
assAnswerCloze$item
Returns
string

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

References $DIC.

Referenced by completeFbPropsForSelectGap().

136  {
137  global $DIC; /* @var ILIAS\DI\Container $DIC */
138 
139  return sprintf(
140  $DIC->language()->txt('ass_cloze_gap_fb_sel_opt_label'),
141  $gapIndex + 1,
142  $item->getAnswertext()
143  );
144  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildTextGapEmptyFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapEmptyFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForTextGap().

125  {
126  global $DIC; /* @var ILIAS\DI\Container $DIC */
127  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_txt_empty_label'), $gapIndex + 1);
128  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildTextGapGivenAnswerFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapGivenAnswerFeedbackLabel (   $gapIndex,
  $item 
)
protected
Parameters
integer$gapIndex
assAnswerCloze$item
Returns
string

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

References $DIC.

Referenced by completeFbPropsForTextGap().

100  {
101  global $DIC; /* @var ILIAS\DI\Container $DIC */
102 
103  return sprintf(
104  $DIC->language()->txt('ass_cloze_gap_fb_txt_match_label'),
105  $gapIndex + 1,
106  $item->getAnswertext()
107  );
108  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ buildTextGapWrongAnswerFeedbackLabel()

ilAssClozeTestFeedback::buildTextGapWrongAnswerFeedbackLabel (   $gapIndex)
protected
Parameters
integer$gapIndex
Returns
string

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

References $DIC.

Referenced by completeFbPropsForTextGap().

115  {
116  global $DIC; /* @var ILIAS\DI\Container $DIC */
117  return sprintf($DIC->language()->txt('ass_cloze_gap_fb_txt_nomatch_label'), $gapIndex + 1);
118  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ cleanupSpecificAnswerFeedbacks()

ilAssClozeTestFeedback::cleanupSpecificAnswerFeedbacks (   $fbMode)
protected

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

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

Referenced by saveSpecificFormProperties().

822  {
823  switch ($fbMode) {
824  case self::FB_MODE_GAP_QUESTION:
825  $feedbackIds = $this->fetchFeedbackIdsForGapQuestionMode();
826  break;
827 
828  case self::FB_MODE_GAP_ANSWERS:
829  $feedbackIds = $this->fetchFeedbackIdsForGapAnswersMode();
830  break;
831 
832  default: $feedbackIds = array();
833  }
834 
835  $this->deleteSpecificAnswerFeedbacksByIds($feedbackIds);
836  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForNumericGap()

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

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

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

Referenced by completeFormPropsForFeedbackModeGapAnswers().

369  {
370  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
371  $this->buildNumericGapValueHitFeedbackLabel($gapIndex),
372  true
373  );
374 
375  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
376 
377  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
378  $propertyLabel,
379  $propertyPostVar,
380  $this->questionOBJ->isAdditionalContentEditingModePageObject()
381  ));
382 
383  if ($gap->numericRangeExists()) {
384  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
385  $this->buildNumericGapRangeHitFeedbackLabel($gapIndex),
386  true
387  );
388 
389  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_RANGE_HIT_INDEX;
390 
391  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
392  $propertyLabel,
393  $propertyPostVar,
394  $this->questionOBJ->isAdditionalContentEditingModePageObject()
395  ));
396  }
397 
398  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
399  $this->buildNumericGapTooLowFeedbackLabel($gapIndex),
400  true
401  );
402 
403  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_TOO_LOW_INDEX;
404 
405  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
406  $propertyLabel,
407  $propertyPostVar,
408  $this->questionOBJ->isAdditionalContentEditingModePageObject()
409  ));
410 
411  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
412  $this->buildNumericGapTooHighFeedbackLabel($gapIndex),
413  true
414  );
415 
416  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_TOO_HIGH_INDEX;
417 
418  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
419  $propertyLabel,
420  $propertyPostVar,
421  $this->questionOBJ->isAdditionalContentEditingModePageObject()
422  ));
423 
424  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
425  $this->buildNumericGapEmptyFeedbackLabel($gapIndex),
426  true
427  );
428 
429  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_NUMERIC_GAP_EMPTY_INDEX;
430 
431  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
432  $propertyLabel,
433  $propertyPostVar,
434  $this->questionOBJ->isAdditionalContentEditingModePageObject()
435  ));
436  }
addSubItem($a_item)
Add Subitem.
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForSelectGap()

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

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

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

Referenced by completeFormPropsForFeedbackModeGapAnswers().

333  {
334  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $optIndex => $item) {
335  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
336  $this->buildSelectGapOptionFeedbackLabel($gapIndex, $item),
337  true
338  );
339 
340  $propertyPostVar = "feedback_answer_{$gapIndex}_{$optIndex}";
341 
342  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
343  $propertyLabel,
344  $propertyPostVar,
345  $this->questionOBJ->isAdditionalContentEditingModePageObject()
346  ));
347  }
348 
349  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
350  $this->buildSelectGapEmptyFeedbackLabel($gapIndex),
351  true
352  );
353 
354  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_SELECT_GAP_EMPTY_INDEX;
355 
356  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
357  $propertyLabel,
358  $propertyPostVar,
359  $this->questionOBJ->isAdditionalContentEditingModePageObject()
360  ));
361  }
buildSelectGapOptionFeedbackLabel($gapIndex, $item)
addSubItem($a_item)
Add Subitem.
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFbPropsForTextGap()

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

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

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

Referenced by completeFormPropsForFeedbackModeGapAnswers().

284  {
285  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $answerIndex => $item) {
286  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
287  $this->buildTextGapGivenAnswerFeedbackLabel($gapIndex, $item),
288  true
289  );
290 
291  $propertyPostVar = "feedback_answer_{$gapIndex}_{$answerIndex}";
292 
293  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
294  $propertyLabel,
295  $propertyPostVar,
296  $this->questionOBJ->isAdditionalContentEditingModePageObject()
297  ));
298  }
299 
300  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
301  $this->buildTextGapWrongAnswerFeedbackLabel($gapIndex),
302  true
303  );
304 
305  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_TEXT_GAP_NOMATCH_INDEX;
306 
307  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
308  $propertyLabel,
309  $propertyPostVar,
310  $this->questionOBJ->isAdditionalContentEditingModePageObject()
311  ));
312 
313  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
314  $this->buildTextGapEmptyFeedbackLabel($gapIndex),
315  true
316  );
317 
318  $propertyPostVar = "feedback_answer_{$gapIndex}_" . self::FB_TEXT_GAP_EMPTY_INDEX;
319 
320  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
321  $propertyLabel,
322  $propertyPostVar,
323  $this->questionOBJ->isAdditionalContentEditingModePageObject()
324  ));
325  }
buildTextGapGivenAnswerFeedbackLabel($gapIndex, $item)
addSubItem($a_item)
Add Subitem.
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeFormPropsForFeedbackModeGapAnswers()

ilAssClozeTestFeedback::completeFormPropsForFeedbackModeGapAnswers ( ilRadioOption  $fbModeOpt)
protected

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

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

Referenced by completeSpecificFormProperties().

257  {
258  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
259  switch ($gap->getType()) {
261 
262  $this->completeFbPropsForTextGap($fbModeOpt, $gap, $gapIndex);
263  break;
264 
266 
267  $this->completeFbPropsForSelectGap($fbModeOpt, $gap, $gapIndex);
268  break;
269 
271 
272  $this->completeFbPropsForNumericGap($fbModeOpt, $gapIndex, $gap);
273  break;
274  }
275  }
276  }
completeFbPropsForTextGap(ilRadioOption $fbModeOpt, assClozeGap $gap, $gapIndex)
completeFbPropsForNumericGap(ilRadioOption $fbModeOpt, $gapIndex, assClozeGap $gap)
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
completeFbPropsForSelectGap(ilRadioOption $fbModeOpt, assClozeGap $gap, $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 240 of file class.ilAssClozeTestFeedback.php.

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

Referenced by completeSpecificFormProperties().

241  {
242  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
243  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
244  $this->buildGapFeedbackLabel($gapIndex, $gap),
245  true
246  );
247 
248  $fbModeOpt->addSubItem($this->buildFeedbackContentFormProperty(
249  $propertyLabel,
250  $this->buildPostVarForFbFieldPerGapQuestion($gapIndex),
251  $this->questionOBJ->isAdditionalContentEditingModePageObject()
252  ));
253  }
254  }
addSubItem($a_item)
Add Subitem.
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
buildGapFeedbackLabel($gapIndex, $gap)
builds an answer option label from given (mixed type) index and answer (overwrites parent method from...
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ completeSpecificFormProperties()

ilAssClozeTestFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)

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

References $DIC, $header, ilPropertyFormGUI\addItem(), completeFormPropsForFeedbackModeGapAnswers(), completeFormPropsForFeedbackModeGapQuestion(), and ilFormPropertyGUI\setRequired().

207  {
208  global $DIC; /* @var ILIAS\DI\Container $DIC */
209 
210  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
212  $header->setTitle($this->lng->txt('feedback_answers'));
213  $form->addItem($header);
214 
215  $feedbackMode = new ilRadioGroupInputGUI(
216  $DIC->language()->txt('ass_cloze_fb_mode'),
217  'feedback_mode'
218  );
219  $feedbackMode->setRequired(true);
220  $form->addItem($feedbackMode);
221 
222  $fbModeGapQuestion = new ilRadioOption(
223  $DIC->language()->txt('ass_cloze_fb_mode_gap_qst'),
224  self::FB_MODE_GAP_QUESTION,
225  $DIC->language()->txt('ass_cloze_fb_mode_gap_qst_info')
226  );
227  $this->completeFormPropsForFeedbackModeGapQuestion($fbModeGapQuestion);
228  $feedbackMode->addOption($fbModeGapQuestion);
229 
230  $fbModeGapAnswers = new ilRadioOption(
231  $DIC->language()->txt('ass_cloze_fb_mode_gap_answ'),
232  self::FB_MODE_GAP_ANSWERS,
233  $DIC->language()->txt('ass_cloze_fb_mode_gap_answ_info')
234  );
235  $this->completeFormPropsForFeedbackModeGapAnswers($fbModeGapAnswers);
236  $feedbackMode->addOption($fbModeGapAnswers);
237  }
238  }
This class represents an option in a radio group.
completeFormPropsForFeedbackModeGapQuestion(ilRadioOption $fbModeOpt)
global $DIC
Definition: saml.php:7
This class represents a section header in a property form.
completeFormPropsForFeedbackModeGapAnswers(ilRadioOption $fbModeOpt)
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ deleteSpecificAnswerFeedbacksByIds()

ilAssClozeTestFeedback::deleteSpecificAnswerFeedbacksByIds (   $feedbackIds)
protected

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

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

Referenced by cleanupSpecificAnswerFeedbacks().

877  {
878  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
879  foreach ($feedbackIds as $fbId) {
881  }
882  }
883 
884  $IN_feedbackIds = $this->db->in('feedback_id', $feedbackIds, false, 'integer');
885  $this->db->manipulate("DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE {$IN_feedbackIds}");
886  }
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determineAnswerIndexForAnswerValue()

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

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

References CLOZE_NUMERIC, CLOZE_SELECT, CLOZE_TEXT, assClozeGap\getItem(), assClozeGap\getItems(), and assClozeGap\getType().

902  {
903  switch ($gap->getType()) {
904  case CLOZE_TEXT:
905 
906  if (!strlen($answerValue)) {
907  return self::FB_TEXT_GAP_EMPTY_INDEX;
908  }
909 
910  $items = $gap->getItems(new ilArrayElementOrderKeeper());
911 
912  foreach ($items as $answerIndex => $answer) {
913  /* @var assAnswerCloze $answer */
914 
915  if ($answer->getAnswertext() == $answerValue) {
916  return $answerIndex;
917  }
918  }
919 
920  return self::FB_TEXT_GAP_NOMATCH_INDEX;
921 
922  case CLOZE_SELECT:
923 
924  if (strlen($answerValue)) {
925  return $answerValue;
926  }
927 
928  return self::FB_SELECT_GAP_EMPTY_INDEX;
929 
930  case CLOZE_NUMERIC:
931 
932  if (!strlen($answerValue)) {
933  return self::FB_NUMERIC_GAP_EMPTY_INDEX;
934  }
935 
936  /* @var assAnswerCloze $item */
937 
938  $item = current($gap->getItems(new ilArrayElementOrderKeeper()));
939 
940  if ($answerValue == $item->getAnswertext()) {
941  return self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
942  }
943 
944  require_once 'Services/Math/classes/class.EvalMath.php';
945  $math = new EvalMath();
946 
947  $item = $gap->getItem(0);
948  $lowerBound = $math->evaluate($item->getLowerBound());
949  $upperBound = $math->evaluate($item->getUpperBound());
950  $preciseValue = $math->evaluate($item->getAnswertext());
951 
952  $solutionValue = $math->evaluate($answerValue);
953 
954  if ($solutionValue == $preciseValue) {
955  return self::FB_NUMERIC_GAP_VALUE_HIT_INDEX;
956  }
957 
958  if ($solutionValue >= $lowerBound && $solutionValue <= $upperBound) {
959  return self::FB_NUMERIC_GAP_RANGE_HIT_INDEX;
960  }
961 
962  if ($solutionValue < $lowerBound) {
963  return self::FB_NUMERIC_GAP_TOO_LOW_INDEX;
964  }
965 
966  if ($solutionValue > $upperBound) {
967  return self::FB_NUMERIC_GAP_TOO_HIGH_INDEX;
968  }
969  }
970  }
const CLOZE_TEXT
Cloze question constants.
const CLOZE_SELECT
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
getType()
Gets the cloze gap type.
const CLOZE_NUMERIC
getItem($a_index)
Gets the item with a given index.
+ Here is the call graph for this function:

◆ determineTestOutputGapFeedback()

ilAssClozeTestFeedback::determineTestOutputGapFeedback (   $gapIndex,
  $answerIndex 
)

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

References ilAssMultiOptionQuestionFeedback\getSpecificAnswerFeedbackTestPresentation().

889  {
890  if ($this->questionOBJ->getFeedbackMode() == self::FB_MODE_GAP_QUESTION) {
892  $this->questionOBJ->getId(),
893  $gapIndex,
894  self::SINGLE_GAP_FB_ANSWER_INDEX
895  );
896  }
897 
898  return $this->getSpecificAnswerFeedbackTestPresentation($this->questionOBJ->getId(), $gapIndex, $answerIndex);
899  }
getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex)
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 (   $originalQuestionId,
  $duplicateQuestionId 
)
protected

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

(overwrites the method from parent class, because of individual setting)

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

References syncSpecificFeedbackSetting().

727  {
728  // sync specific feedback setting to duplicated question
729 
730  $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
731 
732  parent::duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
733  }
syncSpecificFeedbackSetting($sourceQuestionId, $targetQuestionId)
+ Here is the call graph for this function:

◆ fetchFeedbackIdsForGapAnswersMode()

ilAssClozeTestFeedback::fetchFeedbackIdsForGapAnswersMode ( )
protected

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

Referenced by cleanupSpecificAnswerFeedbacks().

858  {
859  require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssSpecificFeedbackIdentifierList.php';
860  $feedbackIdentifiers = new ilAssSpecificFeedbackIdentifierList();
861  $feedbackIdentifiers->load($this->questionOBJ->getId());
862 
863  $feedbackIds = array();
864 
865  foreach ($feedbackIdentifiers as $identifier) {
866  if ($identifier->getAnswerIndex() == self::SINGLE_GAP_FB_ANSWER_INDEX) {
867  continue;
868  }
869 
870  $feedbackIds[] = $identifier->getFeedbackId();
871  }
872 
873  return $feedbackIds;
874  }
+ Here is the caller graph for this function:

◆ fetchFeedbackIdsForGapQuestionMode()

ilAssClozeTestFeedback::fetchFeedbackIdsForGapQuestionMode ( )
protected

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

Referenced by cleanupSpecificAnswerFeedbacks().

839  {
840  require_once 'Modules/TestQuestionPool/classes/feedback/class.ilAssSpecificFeedbackIdentifierList.php';
841  $feedbackIdentifiers = new ilAssSpecificFeedbackIdentifierList();
842  $feedbackIdentifiers->load($this->questionOBJ->getId());
843 
844  $feedbackIds = array();
845 
846  foreach ($feedbackIdentifiers as $identifier) {
847  if ($identifier->getAnswerIndex() != self::SINGLE_GAP_FB_ANSWER_INDEX) {
848  continue;
849  }
850 
851  $feedbackIds[] = $identifier->getFeedbackId();
852  }
853 
854  return $feedbackIds;
855  }
+ Here is the caller graph for this function:

◆ getGapsByIndex()

ilAssClozeTestFeedback::getGapsByIndex ( )
protected

returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQuestionFeedback)

Returns
assClozeGap[]

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

Referenced by completeFormPropsForFeedbackModeGapAnswers(), completeFormPropsForFeedbackModeGapQuestion(), initFeedbackFieldsPerGapAnswers(), initFeedbackFieldsPerGapQuestion(), saveFeedbackFieldsPerGapAnswers(), and saveFeedbackFieldsPerGapQuestion().

52  {
53  return $this->questionOBJ->gaps;
54  }
+ Here is the caller graph for this function:

◆ getSpecificAnswerFeedbackFormValue()

ilAssClozeTestFeedback::getSpecificAnswerFeedbackFormValue (   $gapIndex,
  $answerIndex 
)
protected
Parameters
$gapIndex
$answerIndex
Returns
mixed|string

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

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

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

800  {
801  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
802  $pageObjectId = $this->getSpecificAnswerFeedbackPageObjectId(
803  $this->questionOBJ->getId(),
804  $gapIndex,
805  $answerIndex
806  );
807 
808  $value = $this->getPageObjectNonEditableValueHTML(
810  $pageObjectId
811  );
812  } else {
813  $value = $this->questionOBJ->prepareTextareaOutput(
814  $this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $gapIndex, $answerIndex)
815  );
816  }
817 
818  return $value;
819  }
getSpecificAnswerFeedbackPageObjectId($questionId, $questionIndex, $answerIndex)
returns a useable page object id for specific answer feedback page objects for the given question id ...
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex)
returns the SPECIFIC answer feedback content for a given question id and answer index.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForNumericGap()

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

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

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

Referenced by initFeedbackFieldsPerGapAnswers().

525  {
526  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
527  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
528  $form->getItemByPostVar($postVar)->setValue($value);
529 
530  if ($gap->numericRangeExists()) {
531  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
532  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
533  $form->getItemByPostVar($postVar)->setValue($value);
534  }
535 
536  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
537  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
538  $form->getItemByPostVar($postVar)->setValue($value);
539 
540  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
541  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
542  $form->getItemByPostVar($postVar)->setValue($value);
543 
544  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
545  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
546  $form->getItemByPostVar($postVar)->setValue($value);
547  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForSelectGap()

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

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

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

Referenced by initFeedbackFieldsPerGapAnswers().

512  {
513  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $optIndex => $item) {
514  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, $optIndex);
515  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $optIndex);
516  $form->getItemByPostVar($postVar)->setValue($value);
517  }
518 
519  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
520  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
521  $form->getItemByPostVar($postVar)->setValue($value);
522  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex)
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFbPropsForTextGap()

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

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

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

Referenced by initFeedbackFieldsPerGapAnswers().

495  {
496  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $answerIndex => $item) {
497  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex);
498  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex);
499  $form->getItemByPostVar($postVar)->setValue($value);
500  }
501 
502  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
503  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
504  $form->getItemByPostVar($postVar)->setValue($value);
505 
506  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
507  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
508  $form->getItemByPostVar($postVar)->setValue($value);
509  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex)
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
+ 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 472 of file class.ilAssClozeTestFeedback.php.

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

Referenced by initSpecificFormProperties().

473  {
474  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
475  switch ($gap->getType()) {
477 
478  $this->initFbPropsForTextGap($form, $gap, $gapIndex);
479  break;
480 
482 
483  $this->initFbPropsForSelectGap($form, $gap, $gapIndex);
484  break;
485 
487 
488  $this->initFbPropsForNumericGap($form, $gapIndex, $gap);
489  break;
490  }
491  }
492  }
initFbPropsForNumericGap(ilPropertyFormGUI $form, $gapIndex, assClozeGap $gap)
initFbPropsForSelectGap(ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
initFbPropsForTextGap(ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
+ 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 464 of file class.ilAssClozeTestFeedback.php.

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

Referenced by initSpecificFormProperties().

465  {
466  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
467  $value = $this->getSpecificAnswerFeedbackFormValue($gapIndex, self::SINGLE_GAP_FB_ANSWER_INDEX);
468  $form->getItemByPostVar($this->buildPostVarForFbFieldPerGapQuestion($gapIndex))->setValue($value);
469  }
470  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
getSpecificAnswerFeedbackFormValue($gapIndex, $answerIndex)
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSpecificFormProperties()

ilAssClozeTestFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)

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

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

439  {
440  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
441  /* @var ilRadioGroupInputGUI $fbMode */
442  $fbMode = $form->getItemByPostVar('feedback_mode');
443  $fbMode->setValue($this->questionOBJ->getFeedbackMode());
444 
445  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
446  $this->initFeedbackFieldsPerGapQuestion($form);
447  $this->initFeedbackFieldsPerGapAnswers($form);
448  } else {
449  switch ($this->questionOBJ->getFeedbackMode()) {
450  case self::FB_MODE_GAP_QUESTION:
451 
452  $this->initFeedbackFieldsPerGapQuestion($form);
453  break;
454 
455  case self::FB_MODE_GAP_ANSWERS:
456 
457  $this->initFeedbackFieldsPerGapAnswers($form);
458  break;
459  }
460  }
461  }
462  }
initFeedbackFieldsPerGapAnswers(ilPropertyFormGUI $form)
getItemByPostVar($a_post_var)
Get Item by POST variable.
initFeedbackFieldsPerGapQuestion(ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ isSaveableInPageObjectEditingMode()

ilAssClozeTestFeedback::isSaveableInPageObjectEditingMode ( )
Returns
boolean $isSaveableInPageObjectEditingMode

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

60  {
61  return true;
62  }

◆ saveFbPropsForNumericGap()

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

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

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

Referenced by saveFeedbackFieldsPerGapAnswers().

667  {
668  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_VALUE_HIT_INDEX);
669  $value = $form->getItemByPostVar($postVar)->getValue();
671  $this->questionOBJ->getId(),
672  $gapIndex,
673  self::FB_NUMERIC_GAP_VALUE_HIT_INDEX,
674  $value
675  );
676 
677  if ($gap->numericRangeExists()) {
678  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_RANGE_HIT_INDEX);
679  $value = $form->getItemByPostVar($postVar)->getValue();
681  $this->questionOBJ->getId(),
682  $gapIndex,
683  self::FB_NUMERIC_GAP_RANGE_HIT_INDEX,
684  $value
685  );
686  }
687 
688  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_LOW_INDEX);
689  $value = $form->getItemByPostVar($postVar)->getValue();
691  $this->questionOBJ->getId(),
692  $gapIndex,
693  self::FB_NUMERIC_GAP_TOO_LOW_INDEX,
694  $value
695  );
696 
697  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_TOO_HIGH_INDEX);
698  $value = $form->getItemByPostVar($postVar)->getValue();
700  $this->questionOBJ->getId(),
701  $gapIndex,
702  self::FB_NUMERIC_GAP_TOO_HIGH_INDEX,
703  $value
704  );
705 
706  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_NUMERIC_GAP_EMPTY_INDEX);
707  $value = $form->getItemByPostVar($postVar)->getValue();
709  $this->questionOBJ->getId(),
710  $gapIndex,
711  self::FB_NUMERIC_GAP_EMPTY_INDEX,
712  $value
713  );
714  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFbPropsForSelectGap()

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

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

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

Referenced by saveFeedbackFieldsPerGapAnswers().

644  {
645  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $optIndex => $item) {
646  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $optIndex);
647  $value = $form->getItemByPostVar($postVar)->getValue();
649  $this->questionOBJ->getId(),
650  $gapIndex,
651  $optIndex,
652  $value
653  );
654  }
655 
656  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_SELECT_GAP_EMPTY_INDEX);
657  $value = $form->getItemByPostVar($postVar)->getValue();
659  $this->questionOBJ->getId(),
660  $gapIndex,
661  self::FB_SELECT_GAP_EMPTY_INDEX,
662  $value
663  );
664  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveFbPropsForTextGap()

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

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

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

Referenced by saveFeedbackFieldsPerGapAnswers().

612  {
613  foreach ($gap->getItems(new ilArrayElementOrderKeeper()) as $answerIndex => $item) {
614  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex);
615  $value = $form->getItemByPostVar($postVar)->getValue();
617  $this->questionOBJ->getId(),
618  $gapIndex,
619  $answerIndex,
620  $value
621  );
622  }
623 
624  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_NOMATCH_INDEX);
625  $value = $form->getItemByPostVar($postVar)->getValue();
627  $this->questionOBJ->getId(),
628  $gapIndex,
629  self::FB_TEXT_GAP_NOMATCH_INDEX,
630  $value
631  );
632 
633  $postVar = $this->buildPostVarForFbFieldPerGapAnswers($gapIndex, self::FB_TEXT_GAP_EMPTY_INDEX);
634  $value = $form->getItemByPostVar($postVar)->getValue();
636  $this->questionOBJ->getId(),
637  $gapIndex,
638  self::FB_TEXT_GAP_EMPTY_INDEX,
639  $value
640  );
641  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
buildPostVarForFbFieldPerGapAnswers($gapIndex, $answerIndex)
getItems(ilArrayElementShuffler $shuffler)
Gets the items of a cloze gap.
+ 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 589 of file class.ilAssClozeTestFeedback.php.

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

Referenced by saveSpecificFormProperties().

590  {
591  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
592  switch ($gap->getType()) {
594 
595  $this->saveFbPropsForTextGap($form, $gap, $gapIndex);
596  break;
597 
599 
600  $this->saveFbPropsForSelectGap($form, $gap, $gapIndex);
601  break;
602 
604 
605  $this->saveFbPropsForNumericGap($form, $gapIndex, $gap);
606  break;
607  }
608  }
609  }
saveFbPropsForNumericGap(ilPropertyFormGUI $form, $gapIndex, assClozeGap $gap)
saveFbPropsForSelectGap(ilPropertyFormGUI $form, assClozeGap $gap, $gapIndex)
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
saveFbPropsForTextGap(ilPropertyFormGUI $form, assClozeGap $gap, $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 574 of file class.ilAssClozeTestFeedback.php.

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

Referenced by saveSpecificFormProperties().

575  {
576  foreach ($this->getGapsByIndex() as $gapIndex => $gap) {
577  $postVar = $this->buildPostVarForFbFieldPerGapQuestion($gapIndex);
578  $value = $form->getItemByPostVar($postVar)->getValue();
579 
581  $this->questionOBJ->getId(),
582  $gapIndex,
583  self::SINGLE_GAP_FB_ANSWER_INDEX,
584  $value
585  );
586  }
587  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
getGapsByIndex()
returns the answer options mapped by answer index (overwrites parent method from ilAssMultiOptionQues...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSpecificFeedbackMode()

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

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

(It's stored to dataset of question itself)

Parameters
integer$questionId
string$feedbackMode

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

Referenced by saveSpecificFormProperties().

765  {
766  $this->questionOBJ->setFeedbackMode($feedbackMode);
767 
768  $this->db->update(
769  $this->questionOBJ->getAdditionalTableName(),
770  array('feedback_mode' => array('text', $feedbackMode)),
771  array('question_fi' => array('integer', $questionId))
772  );
773  }
+ Here is the caller graph for this function:

◆ saveSpecificFormProperties()

ilAssClozeTestFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)

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

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

550  {
551  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
552  $fbMode = $form->getItemByPostVar('feedback_mode')->getValue();
553 
554  if ($fbMode != $this->questionOBJ->getFeedbackMode()) {
555  $this->cleanupSpecificAnswerFeedbacks($this->questionOBJ->getFeedbackMode());
556  }
557 
558  $this->saveSpecificFeedbackMode($this->questionOBJ->getId(), $fbMode);
559 
560  switch ($this->questionOBJ->getFeedbackMode()) {
561  case self::FB_MODE_GAP_QUESTION:
562 
563  $this->saveFeedbackFieldsPerGapQuestion($form);
564  break;
565 
566  case self::FB_MODE_GAP_ANSWERS:
567 
568  $this->saveFeedbackFieldsPerGapAnswers($form);
569  break;
570  }
571  }
572  }
getItemByPostVar($a_post_var)
Get Item by POST variable.
saveSpecificFeedbackMode($questionId, $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 (   $originalQuestionId,
  $duplicateQuestionId 
)
protected

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

References syncSpecificFeedbackSetting().

753  {
754  $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
755  parent::syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
756  }
syncSpecificFeedbackSetting($sourceQuestionId, $targetQuestionId)
+ Here is the call graph for this function:

◆ syncSpecificFeedbackSetting()

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

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

References $res, and $row.

Referenced by duplicateSpecificFeedback(), and syncSpecificFeedback().

736  {
737  $res = $this->db->queryF(
738  "SELECT feedback_mode FROM {$this->questionOBJ->getAdditionalTableName()} WHERE question_fi = %s",
739  array('integer'),
740  array($sourceQuestionId)
741  );
742 
743  $row = $this->db->fetchAssoc($res);
744 
745  $this->db->update(
746  $this->questionOBJ->getAdditionalTableName(),
747  array( 'feedback_mode' => array('text', $row['feedback_mode']) ),
748  array( 'question_fi' => array('integer', $targetQuestionId) )
749  );
750  }
foreach($_POST as $key=> $value) $res
$row
+ Here is the caller graph for this function:

Field Documentation

◆ $questionOBJ

ilAssClozeTestFeedback::$questionOBJ = null
protected

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

◆ FB_MODE_GAP_ANSWERS

const ilAssClozeTestFeedback::FB_MODE_GAP_ANSWERS = 'gapAnswers'

Definition at line 21 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 20 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 29 of file class.ilAssClozeTestFeedback.php.

◆ FB_NUMERIC_GAP_RANGE_HIT_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_RANGE_HIT_INDEX = 1

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

◆ FB_NUMERIC_GAP_TOO_HIGH_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_TOO_HIGH_INDEX = 3

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

◆ FB_NUMERIC_GAP_TOO_LOW_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_TOO_LOW_INDEX = 2

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

◆ FB_NUMERIC_GAP_VALUE_HIT_INDEX

const ilAssClozeTestFeedback::FB_NUMERIC_GAP_VALUE_HIT_INDEX = 0

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

◆ FB_SELECT_GAP_EMPTY_INDEX

const ilAssClozeTestFeedback::FB_SELECT_GAP_EMPTY_INDEX = -1

Definition at line 28 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 26 of file class.ilAssClozeTestFeedback.php.

◆ FB_TEXT_GAP_NOMATCH_INDEX

const ilAssClozeTestFeedback::FB_TEXT_GAP_NOMATCH_INDEX = -2

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

◆ SINGLE_GAP_FB_ANSWER_INDEX

const ilAssClozeTestFeedback::SINGLE_GAP_FB_ANSWER_INDEX = -10

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


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