ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssConfigurableMultiOptionQuestionFeedback Class Reference
+ Inheritance diagram for ilAssConfigurableMultiOptionQuestionFeedback:
+ Collaboration diagram for ilAssConfigurableMultiOptionQuestionFeedback:

Public Member Functions

 completeSpecificFormProperties (ilPropertyFormGUI $form)
 completes a given form object with the specific form properties required by this question type More...
 
 initSpecificFormProperties (ilPropertyFormGUI $form)
 initialises a given form object's specific form properties relating to this question type More...
 
 saveSpecificFormProperties (ilPropertyFormGUI $form)
 saves a given form object's specific form properties relating to this question type More...
 
 isSaveableInPageObjectEditingMode ()
 returns the fact that the feedback editing form is saveable in page object editing mode, because this question type has additional feedback settings More...
 
 saveSpecificFeedbackSetting ($questionId, $specificFeedbackSetting)
 saves the given specific feedback setting for the given question id to the db. More...
 
- Public Member Functions inherited from ilAssMultiOptionQuestionFeedback
 getSpecificAnswerFeedbackTestPresentation ($questionId, $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, $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, $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, $answerIndex)
 returns the generic feedback export presentation for given question id either for solution completed or incompleted More...
 
 importSpecificAnswerFeedback ($questionId, $answerIndex, $feedbackContent)
 imports the given feedback content as specific feedback for the given question id and answer index More...
 
 specificAnswerFeedbackExists ($answerIndexes)
 
- 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, $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, $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...
 
 saveGenericFeedbackContent ($questionId, $solutionCompleted, $feedbackContent)
 saves GENERIC feedback content for the given question id to the database. More...
 
 saveSpecificAnswerFeedbackContent ($questionId, $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, $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, $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 FEEDBACK_SETTING_ALL = 1
 
const FEEDBACK_SETTING_CHECKED = 2
 
const FEEDBACK_SETTING_CORRECT = 3
 
- Data Fields inherited from ilAssMultiOptionQuestionFeedback
const TABLE_NAME_SPECIFIC_FEEDBACK = 'qpl_fb_specific'
 table name for specific feedback More...
 
- Data Fields inherited from ilAssQuestionFeedback
const CSS_CLASS_FEEDBACK_CORRECT = 'ilc_qfeedr_FeedbackRight'
 
const CSS_CLASS_FEEDBACK_WRONG = 'ilc_qfeedw_FeedbackWrong'
 
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK = 'qfbg'
 type for generic feedback page objects More...
 
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK = 'qfbs'
 type for specific feedback page objects More...
 
const FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID = 1
 id for page object relating to generic incomplete solution feedback More...
 
const FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID = 2
 id for page object relating to generic complete solution feedback More...
 
const TABLE_NAME_GENERIC_FEEDBACK = 'qpl_fb_generic'
 table name for specific feedback More...
 

Protected Member Functions

 getSpecificQuestionTableName ()
 returns the name of question specific table 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...
 
 syncSpecificFeedback ($originalQuestionId, $duplicateQuestionId)
 syncs the SPECIFIC feedback from a duplicated question back to the original question More...
 
- 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, $answerIndex)
 returns the SPECIFIC answer feedback ID for a given question id and answer index. More...
 
 isSpecificAnswerFeedbackId ($feedbackId)
 
 getSpecificAnswerFeedbackIdByAnswerIndexMap ($questionId)
 returns an array mapping feedback ids to answer indexes for all answer options of question More...
 
 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, $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...
 

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...
 
- Protected Attributes inherited from ilAssQuestionFeedback
 $questionOBJ = null
 
 $ctrl = null
 
 $db = null
 
 $lng = null
 
 $page_obj_output_mode = "presentation"
 

Detailed Description

Member Function Documentation

◆ completeSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::completeSpecificFormProperties ( ilPropertyFormGUI  $form)

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

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

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

References $header, $index, ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), ilAssMultiOptionQuestionFeedback\buildAnswerOptionLabel(), ilAssQuestionFeedback\buildFeedbackContentFormProperty(), and ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex().

41  {
42  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
44  $header->setTitle($this->lng->txt('feedback_answers'));
45  $form->addItem($header);
46 
47  require_once './Services/Form/classes/class.ilRadioGroupInputGUI.php';
48  require_once './Services/Form/classes/class.ilRadioOption.php';
49 
50  $feedback = new ilRadioGroupInputGUI($this->lng->txt('feedback_setting'), 'feedback_setting');
51  $feedback->addOption(
52  new ilRadioOption($this->lng->txt('feedback_all'), self::FEEDBACK_SETTING_ALL),
53  true
54  );
55  $feedback->addOption(
56  new ilRadioOption($this->lng->txt('feedback_checked'), self::FEEDBACK_SETTING_CHECKED)
57  );
58  $feedback->addOption(
59  new ilRadioOption($this->lng->txt($this->questionOBJ->getSpecificFeedbackAllCorrectOptionLabel()), self::FEEDBACK_SETTING_CORRECT)
60  );
61 
62  $feedback->setRequired(true);
63  $form->addItem($feedback);
64 
65  foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
66  $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
67  $this->buildAnswerOptionLabel($index, $answer),
68  true
69  );
70 
71  $propertyPostVar = "feedback_answer_$index";
72 
74  $propertyLabel,
75  $propertyPostVar,
76  $this->questionOBJ->isAdditionalContentEditingModePageObject()
77  ));
78  }
79  }
80  }
This class represents an option in a radio group.
getAnswerOptionsByAnswerIndex()
returns the answer options mapped by answer index (can be overwritten by concrete question type class...
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
$index
Definition: metadata.php:60
buildAnswerOptionLabel($index, $answer)
builds an answer option label from given (mixed type) index and answer (can be overwritten by concret...
This class represents a property in a property form.
addOption($a_option)
Add Option.
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:

◆ duplicateSpecificFeedback()

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

References $res, $row, array, ilAssQuestionFeedback\duplicatePageObject(), ilAssQuestionFeedback\getSpecificAnswerFeedbackPageObjectType(), ilAssMultiOptionQuestionFeedback\getSpecificFeedbackTableName(), syncSpecificFeedbackSetting(), and time.

178  {
179  // sync specific feedback setting to duplicated question
180 
181  $this->syncSpecificFeedbackSetting($originalQuestionId, $duplicateQuestionId);
182 
183  // sync specific answer feedback to duplicated question
184 
185  $res = $this->db->queryF(
186  "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
187  array('integer'),
188  array($originalQuestionId)
189  );
190 
191  while ($row = $this->db->fetchAssoc($res)) {
192  $nextId = $this->db->nextId($this->getSpecificFeedbackTableName());
193 
194  $this->db->insert($this->getSpecificFeedbackTableName(), array(
195  'feedback_id' => array('integer', $nextId),
196  'question_fi' => array('integer', $duplicateQuestionId),
197  'answer' => array('integer', $row['answer']),
198  'feedback' => array('text', $row['feedback']),
199  'tstamp' => array('integer', time())
200  ));
201 
202  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
203  $pageObjectType = $this->getSpecificAnswerFeedbackPageObjectType();
204  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $nextId, $duplicateQuestionId);
205  }
206  }
207  }
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
getSpecificFeedbackTableName()
returns the table name for specific feedback
foreach($_POST as $key=> $value) $res
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ getSpecificQuestionTableName()

ilAssConfigurableMultiOptionQuestionFeedback::getSpecificQuestionTableName ( )
abstractprotected

returns the name of question specific table

Returns
string

Referenced by saveSpecificFeedbackSetting(), and syncSpecificFeedbackSetting().

+ Here is the caller graph for this function:

◆ initSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::initSpecificFormProperties ( ilPropertyFormGUI  $form)

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

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

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

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

92  {
93  if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
94  $form->getItemByPostVar('feedback_setting')->setValue(
95  $this->questionOBJ->getSpecificFeedbackSetting()
96  );
97 
98  foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
99  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
100  $value = $this->getPageObjectNonEditableValueHTML(
102  $this->getSpecificAnswerFeedbackPageObjectId($this->questionOBJ->getId(), $index)
103  );
104  } else {
105  $value = $this->questionOBJ->prepareTextareaOutput(
106  $this->getSpecificAnswerFeedbackContent($this->questionOBJ->getId(), $index)
107  );
108  }
109 
110  $form->getItemByPostVar("feedback_answer_$index")->setValue($value);
111  }
112  }
113  }
getAnswerOptionsByAnswerIndex()
returns the answer options mapped by answer index (can be overwritten by concrete question type class...
getItemByPostVar($a_post_var)
Get Item by POST variable.
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
$index
Definition: metadata.php:60
getSpecificAnswerFeedbackContent($questionId, $answerIndex)
returns the SPECIFIC answer feedback content for a given question id and answer index.
getSpecificAnswerFeedbackPageObjectId($questionId, $answerIndex)
returns a useable page object id for specific answer feedback page objects for the given question id ...
+ Here is the call graph for this function:

◆ isSaveableInPageObjectEditingMode()

ilAssConfigurableMultiOptionQuestionFeedback::isSaveableInPageObjectEditingMode ( )

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

public

Returns
boolean

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

147  {
148  return true;
149  }

◆ saveSpecificFeedbackSetting()

ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFeedbackSetting (   $questionId,
  $specificFeedbackSetting 
)

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

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

Parameters
integer$questionId
integer$specificFeedbackSetting

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

References array, and getSpecificQuestionTableName().

Referenced by saveSpecificFormProperties().

159  {
160  $this->db->update(
162  array('feedback_setting' => array('integer', $specificFeedbackSetting)),
163  array('question_fi' => array('integer', $questionId))
164  );
165  }
getSpecificQuestionTableName()
returns the name of question specific table
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSpecificFormProperties()

ilAssConfigurableMultiOptionQuestionFeedback::saveSpecificFormProperties ( ilPropertyFormGUI  $form)

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

(overwrites the method from ilAssMultiOptionQuestionFeedback, because of individual setting)

public

Parameters
ilPropertyFormGUI$form

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

References $index, ilAssMultiOptionQuestionFeedback\getAnswerOptionsByAnswerIndex(), ilPropertyFormGUI\getInput(), ilAssMultiOptionQuestionFeedback\saveSpecificAnswerFeedbackContent(), and saveSpecificFeedbackSetting().

125  {
126  $this->saveSpecificFeedbackSetting($this->questionOBJ->getId(), $form->getInput('feedback_setting'));
127 
128  if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
129  foreach ($this->getAnswerOptionsByAnswerIndex() as $index => $answer) {
131  $this->questionOBJ->getId(),
132  $index,
133  $form->getInput("feedback_answer_$index")
134  );
135  }
136  }
137  }
getAnswerOptionsByAnswerIndex()
returns the answer options mapped by answer index (can be overwritten by concrete question type class...
saveSpecificAnswerFeedbackContent($questionId, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
$index
Definition: metadata.php:60
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
saveSpecificFeedbackSetting($questionId, $specificFeedbackSetting)
saves the given specific feedback setting for the given question id to the db.
+ Here is the call graph for this function:

◆ syncSpecificFeedback()

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

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

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

protected

Parameters
integer$originalQuestionId
integer$duplicateQuestionId

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

References $res, $row, array, ilAssMultiOptionQuestionFeedback\getSpecificFeedbackTableName(), syncSpecificFeedbackSetting(), and time.

219  {
220  // sync specific feedback setting to the original
221  $this->syncSpecificFeedbackSetting($duplicateQuestionId, $originalQuestionId);
222 
223  // delete specific feedback of the original
224  $this->db->manipulateF(
225  "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
226  array('integer'),
227  array($originalQuestionId)
228  );
229 
230  // get specific feedback of the actual question
231  $res = $this->db->queryF(
232  "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
233  array('integer'),
234  array($duplicateQuestionId)
235  );
236 
237  // save specific feedback to the original
238  while ($row = $this->db->fetchAssoc($res)) {
239  $nextId = $this->db->nextId($this->getSpecificFeedbackTableName());
240 
241  $this->db->insert($this->getSpecificFeedbackTableName(), array(
242  'feedback_id' => array('integer', $nextId),
243  'question_fi' => array('integer', $originalQuestionId),
244  'answer' => array('integer',$row['answer']),
245  'feedback' => array('text',$row['feedback']),
246  'tstamp' => array('integer',time())
247  ));
248  }
249  }
getSpecificFeedbackTableName()
returns the table name for specific feedback
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ syncSpecificFeedbackSetting()

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

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

References $res, $row, array, and getSpecificQuestionTableName().

Referenced by duplicateSpecificFeedback(), and syncSpecificFeedback().

252  {
253  $res = $this->db->queryF(
254  "SELECT feedback_setting FROM {$this->getSpecificQuestionTableName()} WHERE question_fi = %s",
255  array('integer'),
256  array($sourceQuestionId)
257  );
258 
259  $row = $this->db->fetchAssoc($res);
260 
261  $this->db->update(
263  array( 'feedback_setting' => array('integer', $row['feedback_setting']) ),
264  array( 'question_fi' => array('integer', $targetQuestionId) )
265  );
266  }
foreach($_POST as $key=> $value) $res
getSpecificQuestionTableName()
returns the name of question specific table
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ FEEDBACK_SETTING_ALL

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_ALL = 1

◆ FEEDBACK_SETTING_CHECKED

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_CHECKED = 2

◆ FEEDBACK_SETTING_CORRECT

const ilAssConfigurableMultiOptionQuestionFeedback::FEEDBACK_SETTING_CORRECT = 3

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