4require_once
'Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php';
35 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
47 return $specificAnswerFeedbackTestPresentationHTML;
59 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
61 $header->setTitle($this->lng->txt(
'feedback_answers'));
65 $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
70 $propertyPostVar =
"feedback_answer_$index";
75 $this->questionOBJ->isAdditionalContentEditingModePageObject()
90 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
92 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
98 $value = $this->questionOBJ->prepareTextareaOutput(
103 $form->getItemByPostVar(
"feedback_answer_$index")->setValue($value);
117 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
120 $this->questionOBJ->getId(),
122 $form->getInput(
"feedback_answer_$index")
138 require_once
'Services/RTE/classes/class.ilRTE.php';
140 $res = $this->db->queryF(
141 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s AND answer = %s",
142 array(
'integer',
'integer'),
143 array($questionId, $answerIndex)
146 while (
$row = $this->db->fetchAssoc(
$res)) {
151 return $feedbackContent;
164 require_once
'Services/RTE/classes/class.ilRTE.php';
166 $res = $this->db->queryF(
167 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
172 $allFeedbackContents =
'';
174 while (
$row = $this->db->fetchAssoc(
$res)) {
178 return $allFeedbackContents;
192 require_once
'Services/RTE/classes/class.ilRTE.php';
194 if (strlen($feedbackContent)) {
204 'feedback' => array(
'text', $feedbackContent),
205 'tstamp' => array(
'integer', time())
208 'feedback_id' => array(
'integer', $feedbackId),
215 'feedback_id' => array(
'integer', $feedbackId),
216 'question_fi' => array(
'integer', $questionId),
217 'answer' => array(
'integer', $answerIndex),
218 'feedback' => array(
'text', $feedbackContent),
219 'tstamp' => array(
'integer', time())
236 if ($isAdditionalContentEditingModePageObject) {
242 $this->db->manipulateF(
243 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
258 $res = $this->db->queryF(
259 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
261 array($originalQuestionId)
264 while (
$row = $this->db->fetchAssoc(
$res)) {
268 'feedback_id' => array(
'integer', $nextId),
269 'question_fi' => array(
'integer', $duplicateQuestionId),
270 'answer' => array(
'integer',
$row[
'answer']),
271 'feedback' => array(
'text',
$row[
'feedback']),
272 'tstamp' => array(
'integer', time())
275 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
292 $this->db->manipulateF(
293 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
295 array($originalQuestionId)
299 $res = $this->db->queryF(
300 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
302 array($duplicateQuestionId)
306 while (
$row = $this->db->fetchAssoc(
$res)) {
310 'feedback_id' => array(
'integer', $nextId),
311 'question_fi' => array(
'integer', $originalQuestionId),
312 'answer' => array(
'integer',
$row[
'answer']),
313 'feedback' => array(
'text',
$row[
'feedback']),
314 'tstamp' => array(
'integer',time())
330 $res = $this->db->queryF(
331 "SELECT feedback_id FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s AND answer = %s",
332 array(
'integer',
'integer'),
333 array($questionId, $answerIndex)
338 while (
$row = $this->db->fetchAssoc(
$res)) {
339 $feedbackId =
$row[
'feedback_id'];
352 $row = $this->db->fetchAssoc($this->db->queryF(
353 "SELECT COUNT(feedback_id) cnt FROM {$this->getSpecificFeedbackTableName()}
354 WHERE question_fi = %s AND feedback_id = %s",
355 array(
'integer',
'integer'),
356 array($this->questionOBJ->getId(), $feedbackId)
359 return (
bool)
$row[
'cnt'];
373 $res = $this->db->queryF(
374 "SELECT feedback_id, answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
379 $feedbackIdByAnswerIndexMap = array();
381 while (
$row = $this->db->fetchAssoc(
$res)) {
382 $feedbackIdByAnswerIndexMap[
$row[
'answer'] ] =
$row[
'feedback_id'];
385 return $feedbackIdByAnswerIndexMap;
407 return $this->questionOBJ->getAnswers();
421 return $answer->getAnswertext();
439 if (!$pageObjectId) {
443 return $pageObjectId;
457 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
469 return $specificAnswerFeedbackExportPresentation;
483 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
495 foreach ($answerIndexes as $answerIndex) {
An exception for terminatinating execution or to throw for unit testing.
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.
completeSpecificFormProperties(ilPropertyFormGUI $form)
completes a given form object with the specific form properties required by this question type
getSpecificAnswerFeedbackContent($questionId, $answerIndex)
returns the SPECIFIC answer feedback content for a given question id and answer index.
getSpecificAnswerFeedbackExportPresentation($questionId, $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all SPECIFIC answer feedback contents (and page objects if required) for the given question i...
getSpecificAnswerFeedbackPageObjectId($questionId, $answerIndex)
returns a useable page object id for specific answer feedback page objects for the given question id ...
isSpecificAnswerFeedbackId($feedbackId)
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object's specific form properties relating to this question type
getAnswerOptionsByAnswerIndex()
returns the answer options mapped by answer index (can be overwritten by concrete question type class...
getSpecificFeedbackTableName()
returns the table name for specific feedback
getSpecificAnswerFeedbackIdByAnswerIndexMap($questionId)
returns an array mapping feedback ids to answer indexes for all answer options of question
specificAnswerFeedbackExists($answerIndexes)
importSpecificAnswerFeedback($questionId, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index
const TABLE_NAME_SPECIFIC_FEEDBACK
table name for specific feedback
saveSpecificAnswerFeedbackContent($questionId, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database.
buildAnswerOptionLabel($index, $answer)
builds an answer option label from given (mixed type) index and answer (can be overwritten by concret...
getSpecificAnswerFeedbackId($questionId, $answerIndex)
returns the SPECIFIC answer feedback ID for a given question id and answer index.
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object's specific form properties relating to this question type
getPageObjectXML($pageObjectType, $pageObjectId)
returns the xml of page object with given type and id
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
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
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
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...
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res