ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAssQuestionFeedback.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
15{
16 const CSS_CLASS_FEEDBACK_CORRECT = 'ilc_qfeedr_FeedbackRight';
17 const CSS_CLASS_FEEDBACK_WRONG = 'ilc_qfeedw_FeedbackWrong';
18
23
28
33
38
42 const TABLE_NAME_GENERIC_FEEDBACK = 'qpl_fb_generic';
43
50 protected $questionOBJ = null;
51
58 protected $ctrl = null;
59
66 protected $db = null;
67
74 protected $lng = null;
75
82 protected $page_obj_output_mode = "presentation";
83
95 {
96 $this->questionOBJ = $questionOBJ;
97
98 $this->ctrl = $ctrl;
99 $this->lng = $lng;
100 $this->db = $db;
101 }
102
112 public function getGenericFeedbackTestPresentation($questionId, $solutionCompleted)
113 {
114 if ($this->page_obj_output_mode == "edit") {
115 return "";
116 }
117 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
118 $genericFeedbackTestPresentationHTML = $this->getPageObjectContent(
120 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
121 );
122 } else {
123 $genericFeedbackTestPresentationHTML = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
124 }
125
126 return $genericFeedbackTestPresentationHTML;
127 }
128
140 abstract public function getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex);
141
151 {
153 $this->lng->txt('feedback_complete_solution'),
154 'feedback_complete',
155 $this->questionOBJ->isAdditionalContentEditingModePageObject()
156 ));
157
159 $this->lng->txt('feedback_incomplete_solution'),
160 'feedback_incomplete',
161 $this->questionOBJ->isAdditionalContentEditingModePageObject()
162 ));
163 }
164
173 abstract public function completeSpecificFormProperties(ilPropertyFormGUI $form);
174
183 final public function initGenericFormProperties(ilPropertyFormGUI $form)
184 {
185 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
186 $pageObjectType = $this->getGenericFeedbackPageObjectType();
187
188 $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
189 $pageObjectType,
190 $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
191 );
192
193 $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
194 $pageObjectType,
195 $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
196 );
197 } else {
198 $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
199 $this->questionOBJ->getId(),
200 true
201 );
202
203 $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
204 $this->questionOBJ->getId(),
205 false
206 );
207 }
208
209 $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
210 $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
211 }
212
221 abstract public function initSpecificFormProperties(ilPropertyFormGUI $form);
222
231 final public function saveGenericFormProperties(ilPropertyFormGUI $form)
232 {
233 if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
234 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, $form->getInput('feedback_incomplete'));
235 $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, $form->getInput('feedback_complete'));
236 }
237 }
238
247 abstract public function saveSpecificFormProperties(ilPropertyFormGUI $form);
248
258 {
259 return false;
260 }
261
276 final protected function buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
277 {
278 if ($asNonEditable) {
279 require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
280
281 $property = new ilNonEditableValueGUI($label, $postVar, true);
282 } else {
283 require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
284 require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
285
286 $property = new ilTextAreaInputGUI($label, $postVar);
287 $property->setRequired(false);
288 $property->setRows(10);
289 $property->setCols(80);
290
291 if (!$this->questionOBJ->getPreventRteUsage()) {
292 $property->setUseRte(true);
293 $property->addPlugin("latex");
294 $property->addButton("latex");
295 $property->addButton("pastelatex");
296
297 require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
298 $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
299 $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
300 } else {
301 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
303 $property->setUseTagsForRteOnly(false);
304 }
305
306 $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
307 }
308
309 return $property;
310 }
311
323 final public function getGenericFeedbackContent($questionId, $solutionCompleted)
324 {
325 require_once 'Services/RTE/classes/class.ilRTE.php';
326
327 $correctness = $solutionCompleted ? 1 : 0;
328
329 $res = $this->db->queryF(
330 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
331 array('integer', 'text'),
332 array($questionId, $correctness)
333 );
334
335 $feedbackContent = null;
336
337 while ($row = $this->db->fetchAssoc($res)) {
338 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
339 break;
340 }
341
342 return is_null($feedbackContent) ? '' : $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
343 }
344
355 abstract public function getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex);
356
365 abstract public function getAllSpecificAnswerFeedbackContents($questionId);
366
373 public function isSpecificAnswerFeedbackAvailable($questionId)
374 {
375 $res = $this->db->queryF(
376 "SELECT answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
377 ['integer'],
378 [$questionId]
379 );
380
381 $allFeedbackContents = '';
382
383 while ($row = $this->db->fetchAssoc($res)) {
384 $allFeedbackContents .= $this->getSpecificAnswerFeedbackExportPresentation(
385 $this->questionOBJ->getId(),
386 0,
387 $row['answer']
388 );
389 }
390
391 return (bool) strlen(trim(strip_tags($allFeedbackContents)));
392 }
393
406 final public function saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
407 {
408 require_once 'Services/RTE/classes/class.ilRTE.php';
409
410 $correctness = $solutionCompleted ? 1 : 0;
411
412 $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
413
414 if (strlen($feedbackContent)) {
415 $feedbackContent = $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
416 $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
417 }
418
419 if ($feedbackId) {
420 $this->db->update(
422 array(
423 'feedback' => array('clob', $feedbackContent),
424 'tstamp' => array('integer', time())
425 ),
426 array(
427 'feedback_id' => array('integer', $feedbackId)
428 )
429 );
430 } else {
431 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
432
433 $this->db->insert($this->getGenericFeedbackTableName(), array(
434 'feedback_id' => array('integer', $feedbackId),
435 'question_fi' => array('integer', $questionId),
436 'correctness' => array('text', $correctness), // text ?
437 'feedback' => array('clob', $feedbackContent),
438 'tstamp' => array('integer', time())
439 ));
440 }
441
442 return $feedbackId;
443 }
444
456 abstract public function saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent);
457
467 final public function deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
468 {
469 if ($isAdditionalContentEditingModePageObject) {
472 $this->getGenericFeedbackPageObjectId($questionId, true)
473 );
474
477 $this->getGenericFeedbackPageObjectId($questionId, false)
478 );
479 }
480
481 $this->db->manipulateF(
482 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
483 array('integer'),
484 array($questionId)
485 );
486 }
487
496 abstract public function deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject);
497
507 final public function duplicateFeedback($originalQuestionId, $duplicateQuestionId)
508 {
509 $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
510 $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
511 }
512
522 private function duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
523 {
524 $res = $this->db->queryF(
525 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
526 array('integer'),
527 array($originalQuestionId)
528 );
529
530 while ($row = $this->db->fetchAssoc($res)) {
531 $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
532
533 $this->db->insert($this->getGenericFeedbackTableName(), array(
534 'feedback_id' => array('integer', $feedbackId),
535 'question_fi' => array('integer', $duplicateQuestionId),
536 'correctness' => array('text', $row['correctness']),
537 'feedback' => array('clob', $row['feedback']),
538 'tstamp' => array('integer', time())
539 ));
540
541 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
542 $pageObjectType = $this->getGenericFeedbackPageObjectType();
543 $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
544 }
545 }
546 }
547
557 abstract protected function duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
558
567 final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
568 {
569 $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
570 $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
571 }
572
581 private function syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
582 {
583 // delete generic feedback of the original question
584 $this->db->manipulateF(
585 "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
586 array('integer'),
587 array($originalQuestionId)
588 );
589
590 // get generic feedback of the actual (duplicated) question
591 $result = $this->db->queryF(
592 "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
593 array('integer'),
594 array($duplicateQuestionId)
595 );
596
597 // save generic feedback to the original question
598 while ($row = $this->db->fetchAssoc($result)) {
599 $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
600
601 $this->db->insert($this->getGenericFeedbackTableName(), array(
602 'feedback_id' => array('integer', $nextId),
603 'question_fi' => array('integer', $originalQuestionId),
604 'correctness' => array('text', $row['correctness']),
605 'feedback' => array('clob', $row['feedback']),
606 'tstamp' => array('integer', time())
607 ));
608 }
609 }
610
620 final protected function getGenericFeedbackId($questionId, $solutionCompleted)
621 {
622 $res = $this->db->queryF(
623 "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
624 array('integer','text'),
625 array($questionId, (int) $solutionCompleted)
626 );
627
628 $feedbackId = null;
629
630 while ($row = $this->db->fetchAssoc($res)) {
631 $feedbackId = $row['feedback_id'];
632 break;
633 }
634
635 return $feedbackId;
636 }
637
642 protected function isGenericFeedbackId($feedbackId)
643 {
644 $row = $this->db->fetchAssoc($this->db->queryF(
645 "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()}
646 WHERE question_fi = %s AND feedback_id = %s",
647 array('integer','integer'),
648 array($this->questionOBJ->getId(), $feedbackId)
649 ));
650
651
652 return $row['cnt'];
653 }
654
659 abstract protected function isSpecificAnswerFeedbackId($feedbackId);
660
665 final public function checkFeedbackParent($feedbackId)
666 {
667 if ($this->isGenericFeedbackId($feedbackId)) {
668 return true;
669 }
670
671 if ($this->isSpecificAnswerFeedbackId($feedbackId)) {
672 return true;
673 }
674
675 return false;
676 }
677
686 abstract protected function syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
687
694 final protected function getGenericFeedbackTableName()
695 {
697 }
698
709 final protected function getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
710 {
711 $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
712 $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
713
714 return "$link<br /><br />$content";
715 }
716
723 public function getClassNameByType($a_type, $a_gui = false)
724 {
725 $gui = ($a_gui)
726 ? "GUI"
727 : "";
728 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
730 return "ilAssGenFeedbackPage" . $gui;
731 }
733 return "ilAssSpecFeedbackPage" . $gui;
734 }
735 }
736
737
748 private function getPageObjectEditingLink($pageObjectType, $pageObjectId)
749 {
750 $cl = $this->getClassNameByType($pageObjectType, true);
751 $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
752 $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
753
754 $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
755 $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
756
757 return "<a href='$linkHREF'>$linkTEXT</a>";
758 }
759
765 final public function setPageObjectOutputMode($a_val)
766 {
767 $this->page_obj_output_mode = $a_val;
768 }
769
775 final public function getPageObjectOutputMode()
776 {
778 }
779
789 final protected function getPageObjectContent($pageObjectType, $pageObjectId)
790 {
791 global $DIC;
792 $ilCtrl = $DIC['ilCtrl'];
793
794 $cl = $this->getClassNameByType($pageObjectType, true);
795 require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
796
797 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
798
799 $mode = ($ilCtrl->isAsynch())
800 ? "presentation"
801 : $this->getPageObjectOutputMode();
802
803 $pageObjectGUI = new $cl($pageObjectId);
804 $pageObjectGUI->setOutputMode($mode);
805
806 return $pageObjectGUI->presentation($mode);
807 }
808
818 final protected function getPageObjectXML($pageObjectType, $pageObjectId)
819 {
820 $cl = $this->getClassNameByType($pageObjectType);
821 require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
822
823 $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
824
825 $pageObject = new $cl($pageObjectId);
826 return $pageObject->getXMLContent();
827 }
828
837 private function ensurePageObjectExists($pageObjectType, $pageObjectId)
838 {
840 && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
841 $pageObject = new ilAssGenFeedbackPage();
842 $pageObject->setParentId($this->questionOBJ->getId());
843 $pageObject->setId($pageObjectId);
844 $pageObject->createFromXML();
845 }
847 && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
848 $pageObject = new ilAssSpecFeedbackPage();
849 $pageObject->setParentId($this->questionOBJ->getId());
850 $pageObject->setId($pageObjectId);
851 $pageObject->createFromXML();
852 }
853 }
854
865 final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
866 {
867 $cl = $this->getClassNameByType($pageObjectType);
868 require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
869
870 $pageObject = new $cl();
871 $pageObject->setParentId($this->questionOBJ->getId());
872 $pageObject->setId($pageObjectId);
873 $pageObject->setXMLContent($pageObjectContent);
874 $pageObject->createFromXML();
875 }
876
888 final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
889 {
890 $this->ensurePageObjectExists($pageObjectType, $originalPageObjectId);
891
892 $cl = $this->getClassNameByType($pageObjectType);
893 require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
894
895 $pageObject = new $cl($originalPageObjectId);
896 $pageObject->setParentId($duplicatePageObjectParentId);
897 $pageObject->setId($duplicatePageObjectId);
898 $pageObject->createFromXML();
899 }
900
909 final protected function ensurePageObjectDeleted($pageObjectType, $pageObjectId)
910 {
912 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
913 if (ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
914 $pageObject = new ilAssGenFeedbackPage($pageObjectId);
915 $pageObject->delete();
916 }
917 }
919 include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
920 if (ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
921 $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
922 $pageObject->delete();
923 }
924 }
925 }
926
935 final protected function getGenericFeedbackPageObjectType()
936 {
938 }
939
949 {
951 }
952
963 final public static function isValidFeedbackPageObjectType($feedbackPageObjectType)
964 {
965 switch ($feedbackPageObjectType) {
968
969 return true;
970 }
971
972 return false;
973 }
974
986 final protected function getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
987 {
988 $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
989
990 if (!$pageObjectId) {
991 $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
992 }
993
994 return $pageObjectId;
995 }
996
1006 public function getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
1007 {
1008 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1009 $genericFeedbackExportPresentation = $this->getPageObjectXML(
1011 $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
1012 );
1013 } else {
1014 $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
1015 }
1016
1017 return $genericFeedbackExportPresentation;
1018 }
1019
1031 abstract public function getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex);
1032
1042 public function importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
1043 {
1044 if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1045 $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
1046 $pageObjectType = $this->getGenericFeedbackPageObjectType();
1047
1048 $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
1049 } else {
1050 $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
1051 }
1052 }
1053
1065 abstract public function importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent);
1066
1071 public function migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
1072 {
1073 $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
1074 $this->getGenericFeedbackContent($questionId, true)
1075 ));
1076
1077 $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
1078 $this->getGenericFeedbackContent($questionId, false)
1079 ));
1080 }
1081}
$result
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.
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
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.
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
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
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
Specific feedback page object.
This class provides processing control methods.
language handling
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.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
getItemByPostVar($a_post_var)
Get Item by POST variable.
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.
global $DIC
Definition: goto.php:24
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
foreach($_POST as $key=> $value) $res