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 is_null($feedbackContent) ?
'' : $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
389 require_once
'Services/RTE/classes/class.ilRTE.php';
391 $correctness = $solutionCompleted ? 1 : 0;
395 if (strlen($feedbackContent)) {
396 $feedbackContent = $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
404 'feedback' => array(
'clob', $feedbackContent),
405 'tstamp' => array(
'integer', time())
408 'feedback_id' => array(
'integer', $feedbackId)
415 'feedback_id' => array(
'integer', $feedbackId),
416 'question_fi' => array(
'integer', $questionId),
417 'correctness' => array(
'text', $correctness),
418 'feedback' => array(
'clob', $feedbackContent),
419 'tstamp' => array(
'integer', time())
450 if ($isAdditionalContentEditingModePageObject) {
462 $this->db->manipulateF(
463 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
505 $res = $this->db->queryF(
506 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
508 array($originalQuestionId)
511 while ($row = $this->db->fetchAssoc(
$res)) {
515 'feedback_id' => array(
'integer', $feedbackId),
516 'question_fi' => array(
'integer', $duplicateQuestionId),
517 'correctness' => array(
'text', $row[
'correctness']),
518 'feedback' => array(
'clob', $row[
'feedback']),
519 'tstamp' => array(
'integer', time())
522 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
524 $this->
duplicatePageObject($pageObjectType, $row[
'feedback_id'], $feedbackId, $duplicateQuestionId);
548 final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
565 $this->db->manipulateF(
566 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
568 array($originalQuestionId)
573 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
575 array($duplicateQuestionId)
579 while ($row = $this->db->fetchAssoc(
$result)) {
583 'feedback_id' => array(
'integer', $nextId),
584 'question_fi' => array(
'integer', $originalQuestionId),
585 'correctness' => array(
'text', $row[
'correctness']),
586 'feedback' => array(
'clob', $row[
'feedback']),
587 'tstamp' => array(
'integer', time())
603 $res = $this->db->queryF(
604 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
605 array(
'integer',
'text'),
606 array($questionId, (
int) $solutionCompleted)
611 while ($row = $this->db->fetchAssoc(
$res)) {
612 $feedbackId = $row[
'feedback_id'];
625 $row = $this->db->fetchAssoc($this->db->queryF(
626 "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()}
627 WHERE question_fi = %s AND feedback_id = %s",
628 array(
'integer',
'integer'),
629 array($this->questionOBJ->getId(), $feedbackId)
695 return "$link<br /><br />$content";
709 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
711 return "ilAssGenFeedbackPage" . $gui;
714 return "ilAssSpecFeedbackPage" . $gui;
732 $this->ctrl->setParameterByClass($cl,
'feedback_type', $pageObjectType);
733 $this->ctrl->setParameterByClass($cl,
'feedback_id', $pageObjectId);
735 $linkHREF = $this->ctrl->getLinkTargetByClass($cl,
'edit');
736 $linkTEXT = $this->lng->txt(
'tst_question_feedback_edit_page');
738 return "<a href='$linkHREF'>$linkTEXT</a>";
748 $this->page_obj_output_mode = $a_val;
776 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
784 $pageObjectGUI =
new $cl($pageObjectId);
785 $pageObjectGUI->setOutputMode($mode);
787 return $pageObjectGUI->presentation($mode);
802 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
806 $pageObject =
new $cl($pageObjectId);
807 return $pageObject->getXMLContent();
821 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
824 $pageObject->setParentId($this->questionOBJ->getId());
825 $pageObject->setId($pageObjectId);
826 $pageObject->createFromXML();
830 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
833 $pageObject->setParentId($this->questionOBJ->getId());
834 $pageObject->setId($pageObjectId);
835 $pageObject->createFromXML();
850 final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
853 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
855 $pageObject =
new $cl();
856 $pageObject->setParentId($this->questionOBJ->getId());
857 $pageObject->setId($pageObjectId);
858 $pageObject->setXMLContent($pageObjectContent);
859 $pageObject->createFromXML();
873 final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
876 require_once
'Modules/TestQuestionPool/classes/feedback/class.' . $cl .
'.php';
878 $pageObject =
new $cl($originalPageObjectId);
879 $pageObject->setParentId($duplicatePageObjectParentId);
880 $pageObject->setId($duplicatePageObjectId);
881 $pageObject->createFromXML();
895 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
898 $pageObject->delete();
902 include_once(
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
905 $pageObject->delete();
948 switch ($feedbackPageObjectType) {
973 if (!$pageObjectId) {
977 return $pageObjectId;
991 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1000 return $genericFeedbackExportPresentation;
1027 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1057 $this->getGenericFeedbackContent($questionId,
true)
1061 $this->getGenericFeedbackContent($questionId,
false)
An exception for terminatinating execution or to throw for unit testing.
Abstract basic class which is to be extended by the concrete assessment question type classes.
Generic feedback page object.
getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
const FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID
id for page object relating to generic complete solution feedback
saveGenericFormProperties(ilPropertyFormGUI $form)
saves a given form object's GENERIC form properties relating to all question types
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
completeGenericFormProperties(ilPropertyFormGUI $form)
completes a given form object with the GENERIC form properties required by all question types
initGenericFormProperties(ilPropertyFormGUI $form)
initialises a given form object's GENERIC form properties relating to all question types
static isValidFeedbackPageObjectType($feedbackPageObjectType)
returns the fact wether the given page object type relates to generic or specific feedback page objec...
getGenericFeedbackTestPresentation($questionId, $solutionCompleted)
returns the html of GENERIC feedback for the given question id for test presentation (either for the ...
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...
getPageObjectOutputMode()
Get page object output mode.
getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
getGenericFeedbackId($questionId, $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index.
checkFeedbackParent($feedbackId)
const TABLE_NAME_GENERIC_FEEDBACK
table name for specific feedback
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
constructor
getGenericFeedbackPageObjectType()
returns the type for generic feedback page objects defined in local constant
importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index
createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
creates a new page object with given page object id and page object type and passed page object conte...
syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all SPECIFIC feedback contents for the given question id
getAllSpecificAnswerFeedbackContents($questionId)
returns the SPECIFIC feedback content for a given question id and answer index.
getGenericFeedbackContent($questionId, $solutionCompleted)
returns the GENERIC feedback content for a given question state.
isSpecificAnswerFeedbackAvailable($questionId)
returns the fact wether any specific feedback content is available or not
const CSS_CLASS_FEEDBACK_WRONG
getPageObjectEditingLink($pageObjectType, $pageObjectId)
returns a link to page object editor for page object with given type and id
setPageObjectOutputMode($a_val)
Set page object output mode.
isGenericFeedbackId($feedbackId)
isSpecificAnswerFeedbackId($feedbackId)
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
getSpecificAnswerFeedbackPageObjectType()
returns the type for specific feedback page objects defined in local constant
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question
completeSpecificFormProperties(ilPropertyFormGUI $form)
completes a given form object with the SPECIFIC form properties required by this question type
ensurePageObjectExists($pageObjectType, $pageObjectId)
ensures an existing page object with given type and id
const CSS_CLASS_FEEDBACK_CORRECT
getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
returns the generic feedback export presentation for given question id either for solution completed ...
ensurePageObjectDeleted($pageObjectType, $pageObjectId)
ensures a no more existing page object for given type and id
const FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID
id for page object relating to generic incomplete solution feedback
isSaveableInPageObjectEditingMode()
returns the fact wether the feedback editing form is saveable in page object editing or not.
getClassNameByType($a_type, $a_gui=false)
Get class name by type.
syncFeedback($originalQuestionId, $duplicateQuestionId)
syncs the feedback from a duplicated question back to the original question
deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
deletes all GENERIC feedback contents (and page objects if required) for the given question id
duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex)
returns the SPECIFIC feedback content for a given question id and answer index.
saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent)
saves SPECIFIC feedback content for the given question id and answer index to the database.
getPageObjectContent($pageObjectType, $pageObjectId)
returns the content of page object with given type and id
importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
imports the given feedback content as generic feedback for the given question id for either the compl...
buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
getGenericFeedbackTableName()
returns the table name for specific feedback
duplicateFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the feedback relating to the given original question id and saves it for the given duplica...
migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object's SPECIFIC form properties relating to this question type
saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object's SPECIFIC form properties relating to this question type
Specific feedback page object.
This class provides processing control methods.
This class represents a non editable value in a property form.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
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...
This class represents a text area property in a property form.
migrateToLmContent($content)
foreach($_POST as $key=> $value) $res