4 require_once
'Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php';
35 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
45 $questionId, $answerIndex
49 return $specificAnswerFeedbackTestPresentationHTML;
61 if( !$this->questionOBJ->getSelfAssessmentEditingMode() )
64 $header->setTitle($this->lng->txt(
'feedback_answers'));
69 $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
73 $propertyPostVar =
"feedback_answer_$index";
76 $propertyLabel , $propertyPostVar, $this->questionOBJ->isAdditionalContentEditingModePageObject()
91 if (!$this->questionOBJ->getSelfAssessmentEditingMode())
95 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
104 $value = $this->questionOBJ->prepareTextareaOutput(
123 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
128 $this->questionOBJ->getId(), $index, $form->
getInput(
"feedback_answer_$index")
144 require_once
'Services/RTE/classes/class.ilRTE.php';
146 $res = $this->db->queryF(
147 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s AND answer = %s",
148 array(
'integer',
'integer'),
array($questionId, $answerIndex)
151 while(
$row = $this->db->fetchAssoc(
$res) )
157 return $feedbackContent;
170 require_once
'Services/RTE/classes/class.ilRTE.php';
172 $res = $this->db->queryF(
173 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
177 $allFeedbackContents =
'';
179 while(
$row = $this->db->fetchAssoc(
$res) )
184 return $allFeedbackContents;
198 require_once
'Services/RTE/classes/class.ilRTE.php';
200 if( strlen($feedbackContent) )
211 'feedback' =>
array(
'text', $feedbackContent),
215 'feedback_id' =>
array(
'integer', $feedbackId),
224 'feedback_id' =>
array(
'integer', $feedbackId),
225 'question_fi' =>
array(
'integer', $questionId),
226 'answer' =>
array(
'integer', $answerIndex),
227 'feedback' =>
array(
'text', $feedbackContent),
245 if( $isAdditionalContentEditingModePageObject )
253 $this->db->manipulateF(
254 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
268 $res = $this->db->queryF(
269 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
273 while(
$row = $this->db->fetchAssoc(
$res) )
278 'feedback_id' =>
array(
'integer', $nextId),
279 'question_fi' =>
array(
'integer', $duplicateQuestionId),
280 'answer' =>
array(
'integer',
$row[
'answer']),
281 'feedback' =>
array(
'text',
$row[
'feedback']),
285 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
303 $this->db->manipulateF(
304 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
array(
'integer'),
array($originalQuestionId)
308 $res = $this->db->queryF(
309 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
array(
'integer'),
array($duplicateQuestionId)
313 while(
$row = $this->db->fetchAssoc(
$res) )
318 'feedback_id' =>
array(
'integer', $nextId),
319 'question_fi' =>
array(
'integer', $originalQuestionId),
320 'answer' =>
array(
'integer',
$row[
'answer']),
321 'feedback' =>
array(
'text',
$row[
'feedback']),
338 $res = $this->db->queryF(
339 "SELECT feedback_id FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s AND answer = %s",
340 array(
'integer',
'integer'),
array($questionId, $answerIndex)
345 while(
$row = $this->db->fetchAssoc(
$res) )
347 $feedbackId =
$row[
'feedback_id'];
360 $row = $this->db->fetchAssoc($this->db->queryF(
361 "SELECT COUNT(feedback_id) cnt FROM {$this->getSpecificFeedbackTableName()} 362 WHERE question_fi = %s AND feedback_id = %s",
363 array(
'integer',
'integer'),
array($this->questionOBJ->getId(), $feedbackId)
366 return (
bool)
$row[
'cnt'];
380 $res = $this->db->queryF(
381 "SELECT feedback_id, answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
385 $feedbackIdByAnswerIndexMap =
array();
387 while(
$row = $this->db->fetchAssoc(
$res) )
389 $feedbackIdByAnswerIndexMap[
$row[
'answer'] ] = $row[
'feedback_id'];
392 return $feedbackIdByAnswerIndexMap;
403 return self::TABLE_NAME_SPECIFIC_FEEDBACK;
414 return $this->questionOBJ->getAnswers();
428 return $answer->getAnswertext();
451 return $pageObjectId;
465 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
475 $questionId, $answerIndex
479 return $specificAnswerFeedbackExportPresentation;
493 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
508 foreach($answerIndexes as $answerIndex)
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
getAnswerOptionsByAnswerIndex()
returns the answer options mapped by answer index (can be overwritten by concrete question type class...
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
saveSpecificAnswerFeedbackContent($questionId, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database...
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
isSpecificAnswerFeedbackId($feedbackId)
getSpecificAnswerFeedbackId($questionId, $answerIndex)
returns the SPECIFIC answer feedback ID for a given question id and answer index. ...
getSpecificFeedbackTableName()
returns the table name for specific feedback
getSpecificAnswerFeedbackTestPresentation($questionId, $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
getAllSpecificAnswerFeedbackContents($questionId)
returns the SPECIFIC feedback content for a given question id and answer index.
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
buildAnswerOptionLabel($index, $answer)
builds an answer option label from given (mixed type) index and answer (can be overwritten by concret...
const TABLE_NAME_SPECIFIC_FEEDBACK
table name for specific feedback
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
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 ...
completeSpecificFormProperties(ilPropertyFormGUI $form)
completes a given form object with the specific form properties required by this question type ...
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object's specific form properties relating to this question type ...
deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all SPECIFIC answer feedback contents (and page objects if required) for the given question i...
Create styles array
The data for the language used.
getSpecificAnswerFeedbackIdByAnswerIndexMap($questionId)
returns an array mapping feedback ids to answer indexes for all answer options of question ...
getPageObjectXML($pageObjectType, $pageObjectId)
returns the xml of page object with given type and id
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id
importSpecificAnswerFeedback($questionId, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index ...
getSpecificAnswerFeedbackExportPresentation($questionId, $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
specificAnswerFeedbackExists($answerIndexes)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object's specific form properties relating to this question type ...
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...