114 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
123 return $genericFeedbackTestPresentationHTML;
150 $this->lng->txt(
'feedback_complete_solution'),
152 $this->questionOBJ->isAdditionalContentEditingModePageObject()
156 $this->lng->txt(
'feedback_incomplete_solution'),
157 'feedback_incomplete',
158 $this->questionOBJ->isAdditionalContentEditingModePageObject()
182 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
196 $this->questionOBJ->getId(),
201 $this->questionOBJ->getId(),
206 $form->
getItemByPostVar(
'feedback_complete')->setValue($valueFeedbackSolutionComplete);
207 $form->
getItemByPostVar(
'feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
230 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
275 if ($asNonEditable) {
276 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()) {
289 $property->setUseRte(
true);
290 $property->addPlugin(
"latex");
291 $property->addButton(
"latex");
292 $property->addButton(
"pastelatex");
294 require_once
'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
296 $property->setRTESupport($this->questionOBJ->getId(),
"qpl",
"assessment");
298 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
300 $property->setUseTagsForRteOnly(
false);
303 $property->setRTESupport($this->questionOBJ->getId(),
"qpl",
"assessment");
322 require_once
'Services/RTE/classes/class.ilRTE.php';
324 $correctness = $solutionCompleted ? 1 : 0;
326 $res = $this->db->queryF(
327 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
328 array(
'integer',
'text'),
329 array($questionId, $correctness)
332 $feedbackContent = null;
334 while (
$row = $this->db->fetchAssoc(
$res)) {
339 return $feedbackContent;
389 require_once
'Services/RTE/classes/class.ilRTE.php';
391 $correctness = $solutionCompleted ? 1 : 0;
395 if (strlen($feedbackContent)) {
403 'feedback' => array(
'clob', $feedbackContent),
404 'tstamp' => array(
'integer', time())
407 'feedback_id' => array(
'integer', $feedbackId)
414 'feedback_id' => array(
'integer', $feedbackId),
415 'question_fi' => array(
'integer', $questionId),
416 'correctness' => array(
'text', $correctness),
417 'feedback' => array(
'clob', $feedbackContent),
418 'tstamp' => array(
'integer', time())
449 if ($isAdditionalContentEditingModePageObject) {
461 $this->db->manipulateF(
462 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
504 $res = $this->db->queryF(
505 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
507 array($originalQuestionId)
510 while (
$row = $this->db->fetchAssoc(
$res)) {
514 'feedback_id' => array(
'integer', $feedbackId),
515 'question_fi' => array(
'integer', $duplicateQuestionId),
516 'correctness' => array(
'text',
$row[
'correctness']),
517 'feedback' => array(
'clob',
$row[
'feedback']),
518 'tstamp' => array(
'integer', time())
521 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
547 final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
564 $this->db->manipulateF(
565 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
567 array($originalQuestionId)
572 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
574 array($duplicateQuestionId)
582 'feedback_id' => array(
'integer', $nextId),
583 'question_fi' => array(
'integer', $originalQuestionId),
584 'correctness' => array(
'text',
$row[
'correctness']),
585 'feedback' => array(
'clob',
$row[
'feedback']),
586 'tstamp' => array(
'integer', time())
602 $res = $this->db->queryF(
603 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
604 array(
'integer',
'text'),
605 array($questionId, (
int) $solutionCompleted)
610 while (
$row = $this->db->fetchAssoc(
$res)) {
611 $feedbackId =
$row[
'feedback_id'];
624 $row = $this->db->fetchAssoc($this->db->queryF(
625 "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()} 626 WHERE question_fi = %s AND feedback_id = %s",
627 array(
'integer',
'integer'),
628 array($this->questionOBJ->getId(), $feedbackId)
676 return self::TABLE_NAME_GENERIC_FEEDBACK;
694 return "$link<br /><br />$content";
708 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
710 return "ilAssGenFeedbackPage" . $gui;
713 return "ilAssSpecFeedbackPage" . $gui;
731 $this->ctrl->setParameterByClass($cl,
'feedback_type', $pageObjectType);
732 $this->ctrl->setParameterByClass($cl,
'feedback_id', $pageObjectId);
734 $linkHREF = $this->ctrl->getLinkTargetByClass($cl,
'edit');
735 $linkTEXT = $this->lng->txt(
'tst_question_feedback_edit_page');
737 return "<a href='$linkHREF'>$linkTEXT</a>";
747 $this->page_obj_output_mode = $a_val;
775 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
783 $pageObjectGUI =
new $cl($pageObjectId);
784 $pageObjectGUI->setOutputMode($mode);
786 return $pageObjectGUI->presentation($mode);
801 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
805 $pageObject =
new $cl($pageObjectId);
806 return $pageObject->getXMLContent();
820 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
823 $pageObject->setParentId($this->questionOBJ->getId());
824 $pageObject->setId($pageObjectId);
825 $pageObject->createFromXML();
829 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
832 $pageObject->setParentId($this->questionOBJ->getId());
833 $pageObject->setId($pageObjectId);
834 $pageObject->createFromXML();
849 final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
852 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
854 $pageObject =
new $cl();
855 $pageObject->setParentId($this->questionOBJ->getId());
856 $pageObject->setId($pageObjectId);
857 $pageObject->setXMLContent($pageObjectContent);
858 $pageObject->createFromXML();
872 final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
875 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
877 $pageObject =
new $cl($originalPageObjectId);
878 $pageObject->setParentId($duplicatePageObjectParentId);
879 $pageObject->setId($duplicatePageObjectId);
880 $pageObject->createFromXML();
894 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
897 $pageObject->delete();
901 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
904 $pageObject->delete();
919 return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
932 return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
947 switch ($feedbackPageObjectType) {
948 case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
949 case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
972 if (!$pageObjectId) {
976 return $pageObjectId;
990 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
999 return $genericFeedbackExportPresentation;
1026 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1056 $this->getGenericFeedbackContent($questionId,
true)
1060 $this->getGenericFeedbackContent($questionId,
false)
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex)
returns the SPECIFIC feedback content for a given question id and answer index.
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object's SPECIFIC form properties relating to this question type ...
checkFeedbackParent($feedbackId)
This class provides processing control methods.
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index ...
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 _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
constructor
static isValidFeedbackPageObjectType($feedbackPageObjectType)
returns the fact wether the given page object type relates to generic or specific feedback page objec...
migrateToLmContent($content)
migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object's SPECIFIC form properties relating to this question type ...
const CSS_CLASS_FEEDBACK_CORRECT
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC feedback content for the given question id and answer index to the database...
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.
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
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
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...
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...
isGenericFeedbackId($feedbackId)
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
const CSS_CLASS_FEEDBACK_WRONG
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 ...
isSpecificAnswerFeedbackId($feedbackId)
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.
getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
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 ...
getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
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.
isSpecificAnswerFeedbackAvailable($questionId)
returns the fact wether any specific feedback content is available or not
getAllSpecificAnswerFeedbackContents($questionId)
returns the SPECIFIC feedback content for a given question id and answer index.
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 ...