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(
105 $form->getItemByPostVar(
"feedback_answer_$index")->setValue($value);
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 while (
$row = $this->db->fetchAssoc(
$res)) {
156 return $feedbackContent;
169 require_once
'Services/RTE/classes/class.ilRTE.php';
171 $res = $this->db->queryF(
172 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
177 $allFeedbackContents =
'';
179 while (
$row = $this->db->fetchAssoc(
$res)) {
183 return $allFeedbackContents;
198 require_once
'Services/RTE/classes/class.ilRTE.php';
200 if (strlen($feedbackContent)) {
210 'feedback' => array(
'text', $feedbackContent),
211 'tstamp' => array(
'integer', time())
214 'feedback_id' => array(
'integer', $feedbackId),
221 'feedback_id' => array(
'integer', $feedbackId),
222 'question_fi' => array(
'integer', $questionId),
223 'question' => array(
'integer', $questionIndex),
224 'answer' => array(
'integer', $answerIndex),
225 'feedback' => array(
'text', $feedbackContent),
226 'tstamp' => array(
'integer', time())
243 if ($isAdditionalContentEditingModePageObject) {
244 require_once
'Modules/TestQuestionPool/classes/feedback/class.ilAssSpecificFeedbackIdentifierList.php';
246 $feedbackIdentifiers->load($questionId);
248 foreach ($feedbackIdentifiers as $identifier) {
251 $identifier->getFeedbackId()
256 $this->db->manipulateF(
257 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
273 $res = $this->db->queryF(
274 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
276 array($originalQuestionId)
279 while (
$row = $this->db->fetchAssoc(
$res)) {
283 'feedback_id' => array(
'integer', $nextId),
284 'question_fi' => array(
'integer', $duplicateQuestionId),
285 'question' => array(
'integer',
$row[
'question']),
286 'answer' => array(
'integer',
$row[
'answer']),
287 'feedback' => array(
'text',
$row[
'feedback']),
288 'tstamp' => array(
'integer', time())
291 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
308 $this->db->manipulateF(
309 "DELETE FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
311 array($originalQuestionId)
315 $res = $this->db->queryF(
316 "SELECT * FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
318 array($duplicateQuestionId)
322 while (
$row = $this->db->fetchAssoc(
$res)) {
326 'feedback_id' => array(
'integer', $nextId),
327 'question_fi' => array(
'integer', $originalQuestionId),
328 'question' => array(
'integer',
$row[
'question']),
329 'answer' => array(
'integer',
$row[
'answer']),
330 'feedback' => array(
'text',
$row[
'feedback']),
331 'tstamp' => array(
'integer',time())
347 $res = $this->db->queryF(
348 "SELECT feedback_id FROM {$this->getSpecificFeedbackTableName()}
349 WHERE question_fi = %s AND question = %s AND answer = %s",
350 array(
'integer',
'integer',
'integer'),
351 array($questionId, $questionIndex, $answerIndex)
356 while (
$row = $this->db->fetchAssoc(
$res)) {
357 $feedbackId =
$row[
'feedback_id'];
370 $row = $this->db->fetchAssoc($this->db->queryF(
371 "SELECT COUNT(feedback_id) cnt FROM {$this->getSpecificFeedbackTableName()}
372 WHERE question_fi = %s AND feedback_id = %s",
373 array(
'integer' ,
'integer'),
374 array($this->questionOBJ->getId(), $feedbackId)
377 return (
bool)
$row[
'cnt'];
399 return $this->questionOBJ->getAnswers();
413 return $answer->getAnswertext();
432 if (!$pageObjectId) {
436 return $pageObjectId;
451 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
464 return $specificAnswerFeedbackExportPresentation;
479 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
491 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...
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res