4require_once
'Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php';
36 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
49 return $specificAnswerFeedbackTestPresentationHTML;
61 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
63 $header->setTitle($this->lng->txt(
'feedback_answers'));
67 $propertyLabel = $this->questionOBJ->prepareTextareaOutput(
72 $propertyPostVar =
"feedback_answer_$index";
77 $this->questionOBJ->isAdditionalContentEditingModePageObject()
92 if (!$this->questionOBJ->getSelfAssessmentEditingMode()) {
94 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
100 $value = $this->questionOBJ->prepareTextareaOutput(
119 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
122 $this->questionOBJ->getId(),
125 $form->
getInput(
"feedback_answer_$index")
142 require_once
'Services/RTE/classes/class.ilRTE.php';
144 $res = $this->db->queryF(
145 "SELECT * FROM {$this->getSpecificFeedbackTableName()}
146 WHERE question_fi = %s AND question = %s AND answer = %s",
147 array(
'integer',
'integer',
'integer'),
148 array($questionId, $questionIndex, $answerIndex)
151 $feedbackContent =
'';
152 while ($row = $this->db->fetchAssoc(
$res)) {
153 if (array_key_exists(
'feedback', $row) && $row[
'feedback'] !==
null) {
159 return $feedbackContent;
172 require_once
'Services/RTE/classes/class.ilRTE.php';
174 $res = $this->db->queryF(
175 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
180 $allFeedbackContents =
'';
182 while ($row = $this->db->fetchAssoc(
$res)) {
186 return $allFeedbackContents;
201 require_once
'Services/RTE/classes/class.ilRTE.php';
203 if (strlen($feedbackContent)) {
213 'feedback' => array(
'text', $feedbackContent),
214 'tstamp' => array(
'integer', time())
217 'feedback_id' => array(
'integer', $feedbackId),
224 'feedback_id' => array(
'integer', $feedbackId),
225 'question_fi' => array(
'integer', $questionId),
226 'question' => array(
'integer', $questionIndex),
227 'answer' => array(
'integer', $answerIndex),
228 'feedback' => array(
'text', $feedbackContent),
229 'tstamp' => array(
'integer', time())
246 if ($isAdditionalContentEditingModePageObject) {
247 require_once
'Modules/TestQuestionPool/classes/feedback/class.ilAssSpecificFeedbackIdentifierList.php';
249 $feedbackIdentifiers->load($questionId);
251 foreach ($feedbackIdentifiers as $identifier) {
254 $identifier->getFeedbackId()
259 $this->db->manipulateF(
260 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
276 $res = $this->db->queryF(
277 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
279 array($originalQuestionId)
282 while ($row = $this->db->fetchAssoc(
$res)) {
286 'feedback_id' => array(
'integer', $nextId),
287 'question_fi' => array(
'integer', $duplicateQuestionId),
288 'question' => array(
'integer', $row[
'question']),
289 'answer' => array(
'integer', $row[
'answer']),
290 'feedback' => array(
'text', $row[
'feedback']),
291 'tstamp' => array(
'integer', time())
294 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
296 $this->
duplicatePageObject($pageObjectType, $row[
'feedback_id'], $nextId, $duplicateQuestionId);
311 $this->db->manipulateF(
312 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
314 array($originalQuestionId)
318 $res = $this->db->queryF(
319 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
321 array($duplicateQuestionId)
325 while ($row = $this->db->fetchAssoc(
$res)) {
329 'feedback_id' => array(
'integer', $nextId),
330 'question_fi' => array(
'integer', $originalQuestionId),
331 'question' => array(
'integer',$row[
'question']),
332 'answer' => array(
'integer',$row[
'answer']),
333 'feedback' => array(
'text',$row[
'feedback']),
334 'tstamp' => array(
'integer',time())
350 $res = $this->db->queryF(
351 "SELECT feedback_id FROM {$this->getSpecificFeedbackTableName()}
352 WHERE question_fi = %s AND question = %s AND answer = %s",
353 array(
'integer',
'integer',
'integer'),
354 array($questionId, $questionIndex, $answerIndex)
359 while ($row = $this->db->fetchAssoc(
$res)) {
360 $feedbackId = $row[
'feedback_id'];
373 $row = $this->db->fetchAssoc($this->db->queryF(
374 "SELECT COUNT(feedback_id) cnt FROM {$this->getSpecificFeedbackTableName()}
375 WHERE question_fi = %s AND feedback_id = %s",
376 array(
'integer' ,
'integer'),
377 array($this->questionOBJ->getId(), $feedbackId)
380 return (
bool) $row[
'cnt'];
402 return $this->questionOBJ->getAnswers();
416 return $answer->getAnswertext();
435 if (!$pageObjectId) {
439 return $pageObjectId;
454 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
467 return $specificAnswerFeedbackExportPresentation;
482 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
494 return (
bool) strlen(
An exception for terminatinating execution or to throw for unit testing.
getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex)
returns the SPECIFIC answer feedback content for a given question id and answer index.
getSpecificAnswerFeedbackId($questionId, $questionIndex, $answerIndex)
returns the SPECIFIC answer feedback ID for a given question id and answer index.
getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
getAllSpecificAnswerFeedbackContents($questionId)
returns the SPECIFIC feedback content for a given question id and answer index.
getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
completeSpecificFormProperties(ilPropertyFormGUI $form)
completes a given form object with the specific form properties required by this question type
deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all SPECIFIC answer feedback contents (and page objects if required) for the given question i...
isSpecificAnswerFeedbackId($feedbackId)
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
specificAnswerFeedbackExists()
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
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC answer feedback content for the given question id and answer index to the database.
getSpecificAnswerFeedbackPageObjectId($questionId, $questionIndex, $answerIndex)
returns a useable page object id for specific answer feedback page objects for the given question id ...
const TABLE_NAME_SPECIFIC_FEEDBACK
table name for specific feedback
buildAnswerOptionLabel($index, $answer)
builds an answer option label from given (mixed type) index and answer (can be overwritten by concret...
importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the 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...
foreach($_POST as $key=> $value) $res