111 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
123 return $genericFeedbackTestPresentationHTML;
149 $this->lng->txt(
'feedback_complete_solution'),
'feedback_complete',
150 $this->questionOBJ->isAdditionalContentEditingModePageObject()
154 $this->lng->txt(
'feedback_incomplete_solution'),
'feedback_incomplete',
155 $this->questionOBJ->isAdditionalContentEditingModePageObject()
179 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
193 $valueFeedbackSolutionComplete = $this->questionOBJ->prepareTextareaOutput(
197 $valueFeedbackSolutionIncomplete = $this->questionOBJ->prepareTextareaOutput(
202 $form->
getItemByPostVar(
'feedback_complete')->setValue($valueFeedbackSolutionComplete);
203 $form->
getItemByPostVar(
'feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
226 if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
274 require_once
'Services/Form/classes/class.ilNonEditableValueGUI.php';
280 require_once
'Services/Form/classes/class.ilTextAreaInputGUI.php';
281 require_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
284 $property->setRequired(
false);
285 $property->setRows(10);
286 $property->setCols(80);
288 if( !$this->questionOBJ->getPreventRteUsage() )
290 $property->setUseRte(
true);
292 $property->addPlugin(
"latex");
293 $property->addButton(
"latex");
294 $property->addButton(
"pastelatex");
297 $property->setRTESupport($this->questionOBJ->getId(),
"qpl",
"assessment");
316 require_once
'Services/RTE/classes/class.ilRTE.php';
318 $correctness = $solutionCompleted ? 1 : 0;
320 $res = $this->db->queryF(
321 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
322 array(
'integer',
'text'), array($questionId, $correctness)
325 $feedbackContent = null;
327 while(
$row = $this->db->fetchAssoc(
$res) )
333 return $feedbackContent;
371 require_once
'Services/RTE/classes/class.ilRTE.php';
373 $correctness = $solutionCompleted ? 1 : 0;
377 if( strlen($feedbackContent) )
387 'feedback' => array(
'clob', $feedbackContent),
388 'tstamp' => array(
'integer', time())
391 'feedback_id' => array(
'integer', $feedbackId)
400 'feedback_id' => array(
'integer', $feedbackId),
401 'question_fi' => array(
'integer', $questionId),
402 'correctness' => array(
'text', $correctness),
403 'feedback' => array(
'clob', $feedbackContent),
404 'tstamp' => array(
'integer', time())
434 if( $isAdditionalContentEditingModePageObject )
447 $this->db->manipulateF(
448 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array(
'integer'), array($questionId)
488 $res = $this->db->queryF(
489 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
490 array(
'integer'), array($originalQuestionId)
493 while(
$row = $this->db->fetchAssoc(
$res) )
498 'feedback_id' => array(
'integer', $feedbackId),
499 'question_fi' => array(
'integer', $duplicateQuestionId),
500 'correctness' => array(
'text',
$row[
'correctness']),
501 'feedback' => array(
'clob',
$row[
'feedback']),
502 'tstamp' => array(
'integer', time())
505 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
532 final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
549 $this->db->manipulateF(
550 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array(
'integer'), array($originalQuestionId)
555 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array(
'integer'), array($duplicateQuestionId)
564 'feedback_id' => array(
'integer', $nextId),
565 'question_fi' => array(
'integer', $originalQuestionId),
566 'correctness' => array(
'text',
$row[
'correctness']),
567 'feedback' => array(
'clob',
$row[
'feedback']),
568 'tstamp' => array(
'integer', time())
584 $res = $this->db->queryF(
585 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
586 array(
'integer',
'text'), array($questionId, (
int)$solutionCompleted)
591 while(
$row = $this->db->fetchAssoc(
$res) )
593 $feedbackId =
$row[
'feedback_id'];
618 return self::TABLE_NAME_GENERIC_FEEDBACK;
636 return "$link<br /><br />$content";
650 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
653 return "ilAssGenFeedbackPage".$gui;
657 return "ilAssSpecFeedbackPage".$gui;
675 $this->ctrl->setParameterByClass($cl,
'feedback_type', $pageObjectType);
676 $this->ctrl->setParameterByClass($cl,
'feedback_id', $pageObjectId);
678 $linkHREF = $this->ctrl->getLinkTargetByClass($cl,
'edit');
679 $linkTEXT = $this->lng->txt(
'tst_question_feedback_edit_page');
681 return "<a href='$linkHREF'>$linkTEXT</a>";
691 $this->page_obj_output_mode = $a_val;
718 require_once
'Modules/TestQuestionPool/classes/feedback/class.'.$cl.
'.php';
722 $mode = ($ilCtrl->isAsynch())
726 $pageObjectGUI =
new $cl($pageObjectId);
727 $pageObjectGUI->setOutputMode($mode);
729 return $pageObjectGUI->presentation($mode);
744 require_once
'Modules/TestQuestionPool/classes/feedback/class.'.$cl.
'.php';
748 $pageObject =
new $cl($pageObjectId);
749 return $pageObject->getXMLContent();
764 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
768 $pageObject->setParentId($this->questionOBJ->getId());
769 $pageObject->setId($pageObjectId);
770 $pageObject->createFromXML();
775 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
779 $pageObject->setParentId($this->questionOBJ->getId());
780 $pageObject->setId($pageObjectId);
781 $pageObject->createFromXML();
796 final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
799 require_once
'Modules/TestQuestionPool/classes/feedback/class.'.$cl.
'.php';
801 $pageObject =
new $cl();
802 $pageObject->setParentId($this->questionOBJ->getId());
803 $pageObject->setId($pageObjectId);
804 $pageObject->setXMLContent($pageObjectContent);
805 $pageObject->createFromXML();
819 final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
822 require_once
'Modules/TestQuestionPool/classes/feedback/class.'.$cl.
'.php';
824 $pageObject =
new $cl($originalPageObjectId);
825 $pageObject->setParentId($duplicatePageObjectParentId);
826 $pageObject->setId($duplicatePageObjectId);
827 $pageObject->createFromXML();
842 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
846 $pageObject->delete();
851 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
855 $pageObject->delete();
870 return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
883 return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
898 switch( $feedbackPageObjectType )
900 case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
901 case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
929 return $pageObjectId;
943 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
955 return $genericFeedbackExportPresentation;
981 if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object's SPECIFIC form properties relating to this question type ...
This class provides processing control methods.
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilDB $db, ilLanguage $lng)
constructor
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with given type and id
getPageObjectOutputMode()
Get page object output mode.
getGenericFeedbackTestPresentation($questionId, $solutionCompleted)
returns the html of GENERIC feedback for the given question id for test presentation (either for the ...
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
Abstract basic class which is to be extended by the concrete assessment question type classes...
getGenericFeedbackTableName()
returns the table name for specific feedback
static isValidFeedbackPageObjectType($feedbackPageObjectType)
returns the fact wether the given page object type relates to generic or specific feedback page objec...
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object's SPECIFIC form properties relating to this question type ...
getSpecificAnswerFeedbackTestPresentation($questionId, $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
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...
deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all GENERIC feedback contents (and page objects if required) for the given question id ...
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
Generic feedback page object.
getSpecificAnswerFeedbackContent($questionId, $answerIndex)
returns the SPECIFIC feedback content for a given question id and answer index.
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
static _exists($a_parent_type, $a_id, $a_lang="")
Checks whether page exists.
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...
const TABLE_NAME_GENERIC_FEEDBACK
table name for specific feedback
duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
importSpecificAnswerFeedback($questionId, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index ...
saveSpecificAnswerFeedbackContent($questionId, $answerIndex, $feedbackContent)
saves SPECIFIC feedback content for the given question id and answer index to the database...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
syncFeedback($originalQuestionId, $duplicateQuestionId)
syncs the feedback from a duplicated question back to the original question
importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
imports the given feedback content as generic feedback for the given question id for either the compl...
const FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID
id for page object relating to generic incomplete solution feedback
deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all SPECIFIC feedback contents for the given question id
Specific feedback page object.
isSaveableInPageObjectEditingMode()
returns the fact wether the feedback editing form is saveable in page object editing or not...
getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
returns the generic feedback export presentation for given question id either for solution completed ...
saveGenericFormProperties(ilPropertyFormGUI $form)
saves a given form object's GENERIC form properties relating to all question types ...
getPageObjectXML($pageObjectType, $pageObjectId)
returns the xml of page object with given type and id
const FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID
id for page object relating to generic complete solution feedback
getGenericFeedbackId($questionId, $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index. ...
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id
This class represents a non editable value in a property form.
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
This class represents a text area property in a property form.
duplicateFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the feedback relating to the given original question id and saves it for the given duplica...
completeGenericFormProperties(ilPropertyFormGUI $form)
completes a given form object with the GENERIC form properties required by all question types ...
completeSpecificFormProperties(ilPropertyFormGUI $form)
completes a given form object with the SPECIFIC form properties required by this question type ...
initGenericFormProperties(ilPropertyFormGUI $form)
initialises a given form object's GENERIC form properties relating to all question types ...
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
setPageObjectOutputMode($a_val)
Set page object output mode.
getAllSpecificAnswerFeedbackContents($questionId)
returns the SPECIFIC 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 ...
getPageObjectEditingLink($pageObjectType, $pageObjectId)
returns a link to page object editor for page object with given type and id
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question ...