ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
14 abstract class ilAssQuestionFeedback
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->questionOBJ->isAdditionalContentEditingModePageObject()) {
115  $genericFeedbackTestPresentationHTML = $this->getPageObjectContent(
117  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
118  );
119  } else {
120  $genericFeedbackTestPresentationHTML = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
121  }
122 
123  return $genericFeedbackTestPresentationHTML;
124  }
125 
137  abstract public function getSpecificAnswerFeedbackTestPresentation($questionId, $questionIndex, $answerIndex);
138 
148  {
150  $this->lng->txt('feedback_complete_solution'),
151  'feedback_complete',
152  $this->questionOBJ->isAdditionalContentEditingModePageObject()
153  ));
154 
156  $this->lng->txt('feedback_incomplete_solution'),
157  'feedback_incomplete',
158  $this->questionOBJ->isAdditionalContentEditingModePageObject()
159  ));
160  }
161 
170  abstract public function completeSpecificFormProperties(ilPropertyFormGUI $form);
171 
180  final public function initGenericFormProperties(ilPropertyFormGUI $form)
181  {
182  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
183  $pageObjectType = $this->getGenericFeedbackPageObjectType();
184 
185  $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
186  $pageObjectType,
187  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
188  );
189 
190  $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
191  $pageObjectType,
192  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
193  );
194  } else {
195  $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
196  $this->questionOBJ->getId(),
197  true
198  );
199 
200  $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
201  $this->questionOBJ->getId(),
202  false
203  );
204  }
205 
206  $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
207  $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
208  }
209 
218  abstract public function initSpecificFormProperties(ilPropertyFormGUI $form);
219 
228  final public function saveGenericFormProperties(ilPropertyFormGUI $form)
229  {
230  if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
231  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, $form->getInput('feedback_incomplete'));
232  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, $form->getInput('feedback_complete'));
233  }
234  }
235 
244  abstract public function saveSpecificFormProperties(ilPropertyFormGUI $form);
245 
255  {
256  return false;
257  }
258 
273  final protected function buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
274  {
275  if ($asNonEditable) {
276  require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
277 
278  $property = new ilNonEditableValueGUI($label, $postVar, true);
279  } else {
280  require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
281  require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
282 
283  $property = new ilTextAreaInputGUI($label, $postVar);
284  $property->setRequired(false);
285  $property->setRows(10);
286  $property->setCols(80);
287 
288  if (!$this->questionOBJ->getPreventRteUsage()) {
289  $property->setUseRte(true);
290  $property->addPlugin("latex");
291  $property->addButton("latex");
292  $property->addButton("pastelatex");
293 
294  require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
295  $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
296  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
297  } else {
298  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
300  $property->setUseTagsForRteOnly(false);
301  }
302 
303  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
304  }
305 
306  return $property;
307  }
308 
320  final public function getGenericFeedbackContent($questionId, $solutionCompleted)
321  {
322  require_once 'Services/RTE/classes/class.ilRTE.php';
323 
324  $correctness = $solutionCompleted ? 1 : 0;
325 
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)
330  );
331 
332  $feedbackContent = null;
333 
334  while ($row = $this->db->fetchAssoc($res)) {
335  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
336  break;
337  }
338 
339  return is_null($feedbackContent) ? '' : $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
340  }
341 
352  abstract public function getSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex);
353 
362  abstract public function getAllSpecificAnswerFeedbackContents($questionId);
363 
370  public function isSpecificAnswerFeedbackAvailable($questionId)
371  {
372  return (bool) strlen($this->getAllSpecificAnswerFeedbackContents($questionId));
373  }
374 
387  final public function saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
388  {
389  require_once 'Services/RTE/classes/class.ilRTE.php';
390 
391  $correctness = $solutionCompleted ? 1 : 0;
392 
393  $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
394 
395  if (strlen($feedbackContent)) {
396  $feedbackContent = $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
397  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
398  }
399 
400  if ($feedbackId) {
401  $this->db->update(
403  array(
404  'feedback' => array('clob', $feedbackContent),
405  'tstamp' => array('integer', time())
406  ),
407  array(
408  'feedback_id' => array('integer', $feedbackId)
409  )
410  );
411  } else {
412  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
413 
414  $this->db->insert($this->getGenericFeedbackTableName(), array(
415  'feedback_id' => array('integer', $feedbackId),
416  'question_fi' => array('integer', $questionId),
417  'correctness' => array('text', $correctness), // text ?
418  'feedback' => array('clob', $feedbackContent),
419  'tstamp' => array('integer', time())
420  ));
421  }
422 
423  return $feedbackId;
424  }
425 
437  abstract public function saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent);
438 
448  final public function deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
449  {
450  if ($isAdditionalContentEditingModePageObject) {
453  $this->getGenericFeedbackPageObjectId($questionId, true)
454  );
455 
458  $this->getGenericFeedbackPageObjectId($questionId, false)
459  );
460  }
461 
462  $this->db->manipulateF(
463  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
464  array('integer'),
465  array($questionId)
466  );
467  }
468 
477  abstract public function deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject);
478 
488  final public function duplicateFeedback($originalQuestionId, $duplicateQuestionId)
489  {
490  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
491  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
492  }
493 
503  private function duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
504  {
505  $res = $this->db->queryF(
506  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
507  array('integer'),
508  array($originalQuestionId)
509  );
510 
511  while ($row = $this->db->fetchAssoc($res)) {
512  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
513 
514  $this->db->insert($this->getGenericFeedbackTableName(), array(
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())
520  ));
521 
522  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
523  $pageObjectType = $this->getGenericFeedbackPageObjectType();
524  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
525  }
526  }
527  }
528 
538  abstract protected function duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
539 
548  final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
549  {
550  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
551  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
552  }
553 
562  private function syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
563  {
564  // delete generic feedback of the original question
565  $this->db->manipulateF(
566  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
567  array('integer'),
568  array($originalQuestionId)
569  );
570 
571  // get generic feedback of the actual (duplicated) question
572  $result = $this->db->queryF(
573  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
574  array('integer'),
575  array($duplicateQuestionId)
576  );
577 
578  // save generic feedback to the original question
579  while ($row = $this->db->fetchAssoc($result)) {
580  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
581 
582  $this->db->insert($this->getGenericFeedbackTableName(), array(
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())
588  ));
589  }
590  }
591 
601  final protected function getGenericFeedbackId($questionId, $solutionCompleted)
602  {
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)
607  );
608 
609  $feedbackId = null;
610 
611  while ($row = $this->db->fetchAssoc($res)) {
612  $feedbackId = $row['feedback_id'];
613  break;
614  }
615 
616  return $feedbackId;
617  }
618 
623  protected function isGenericFeedbackId($feedbackId)
624  {
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)
630  ));
631 
632 
633  return $row['cnt'];
634  }
635 
640  abstract protected function isSpecificAnswerFeedbackId($feedbackId);
641 
646  final public function checkFeedbackParent($feedbackId)
647  {
648  if ($this->isGenericFeedbackId($feedbackId)) {
649  return true;
650  }
651 
652  if ($this->isSpecificAnswerFeedbackId($feedbackId)) {
653  return true;
654  }
655 
656  return false;
657  }
658 
667  abstract protected function syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
668 
675  final protected function getGenericFeedbackTableName()
676  {
677  return self::TABLE_NAME_GENERIC_FEEDBACK;
678  }
679 
690  final protected function getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
691  {
692  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
693  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
694 
695  return "$link<br /><br />$content";
696  }
697 
704  public function getClassNameByType($a_type, $a_gui = false)
705  {
706  $gui = ($a_gui)
707  ? "GUI"
708  : "";
709  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
711  return "ilAssGenFeedbackPage" . $gui;
712  }
714  return "ilAssSpecFeedbackPage" . $gui;
715  }
716  }
717 
718 
729  private function getPageObjectEditingLink($pageObjectType, $pageObjectId)
730  {
731  $cl = $this->getClassNameByType($pageObjectType, true);
732  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
733  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
734 
735  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
736  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
737 
738  return "<a href='$linkHREF'>$linkTEXT</a>";
739  }
740 
746  final public function setPageObjectOutputMode($a_val)
747  {
748  $this->page_obj_output_mode = $a_val;
749  }
750 
756  final public function getPageObjectOutputMode()
757  {
759  }
760 
770  final protected function getPageObjectContent($pageObjectType, $pageObjectId)
771  {
772  global $DIC;
773  $ilCtrl = $DIC['ilCtrl'];
774 
775  $cl = $this->getClassNameByType($pageObjectType, true);
776  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
777 
778  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
779 
780  $mode = ($ilCtrl->isAsynch())
781  ? "presentation"
782  : $this->getPageObjectOutputMode();
783 
784  $pageObjectGUI = new $cl($pageObjectId);
785  $pageObjectGUI->setOutputMode($mode);
786 
787  return $pageObjectGUI->presentation($mode);
788  }
789 
799  final protected function getPageObjectXML($pageObjectType, $pageObjectId)
800  {
801  $cl = $this->getClassNameByType($pageObjectType);
802  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
803 
804  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
805 
806  $pageObject = new $cl($pageObjectId);
807  return $pageObject->getXMLContent();
808  }
809 
818  private function ensurePageObjectExists($pageObjectType, $pageObjectId)
819  {
821  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
822  if (!ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
823  $pageObject = new ilAssGenFeedbackPage();
824  $pageObject->setParentId($this->questionOBJ->getId());
825  $pageObject->setId($pageObjectId);
826  $pageObject->createFromXML();
827  }
828  }
830  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
831  if (!ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
832  $pageObject = new ilAssSpecFeedbackPage();
833  $pageObject->setParentId($this->questionOBJ->getId());
834  $pageObject->setId($pageObjectId);
835  $pageObject->createFromXML();
836  }
837  }
838  }
839 
850  final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
851  {
852  $cl = $this->getClassNameByType($pageObjectType);
853  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
854 
855  $pageObject = new $cl();
856  $pageObject->setParentId($this->questionOBJ->getId());
857  $pageObject->setId($pageObjectId);
858  $pageObject->setXMLContent($pageObjectContent);
859  $pageObject->createFromXML();
860  }
861 
873  final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
874  {
875  $cl = $this->getClassNameByType($pageObjectType);
876  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
877 
878  $pageObject = new $cl($originalPageObjectId);
879  $pageObject->setParentId($duplicatePageObjectParentId);
880  $pageObject->setId($duplicatePageObjectId);
881  $pageObject->createFromXML();
882  }
883 
892  final protected function ensurePageObjectDeleted($pageObjectType, $pageObjectId)
893  {
895  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
896  if (ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
897  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
898  $pageObject->delete();
899  }
900  }
902  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
903  if (ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
904  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
905  $pageObject->delete();
906  }
907  }
908  }
909 
918  final protected function getGenericFeedbackPageObjectType()
919  {
920  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
921  }
922 
931  final protected function getSpecificAnswerFeedbackPageObjectType()
932  {
933  return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
934  }
935 
946  final public static function isValidFeedbackPageObjectType($feedbackPageObjectType)
947  {
948  switch ($feedbackPageObjectType) {
949  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
950  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
951 
952  return true;
953  }
954 
955  return false;
956  }
957 
969  final protected function getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
970  {
971  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
972 
973  if (!$pageObjectId) {
974  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
975  }
976 
977  return $pageObjectId;
978  }
979 
989  public function getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
990  {
991  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
992  $genericFeedbackExportPresentation = $this->getPageObjectXML(
994  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
995  );
996  } else {
997  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
998  }
999 
1000  return $genericFeedbackExportPresentation;
1001  }
1002 
1014  abstract public function getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex);
1015 
1025  public function importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
1026  {
1027  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1028  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
1029  $pageObjectType = $this->getGenericFeedbackPageObjectType();
1030 
1031  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
1032  } else {
1033  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
1034  }
1035  }
1036 
1048  abstract public function importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent);
1049 
1054  public function migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
1055  {
1056  $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
1057  $this->getGenericFeedbackContent($questionId, true)
1058  ));
1059 
1060  $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
1061  $this->getGenericFeedbackContent($questionId, false)
1062  ));
1063  }
1064 }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
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&#39;s SPECIFIC form properties relating to this question type ...
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...
getItemByPostVar($a_post_var)
Get Item by POST variable.
importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent)
imports the given feedback content as specific feedback for the given question id and answer index ...
$result
getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
This class represents a property form user interface.
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...
migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
addItem($a_item)
Add Item (Property, SectionHeader).
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object&#39;s SPECIFIC form properties relating to this question type ...
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.
global $ilCtrl
Definition: ilias.php:18
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
Interface ilDBInterface.
$a_type
Definition: workflow.php:92
foreach($_POST as $key=> $value) $res
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...
duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
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&#39;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...
$DIC
Definition: xapitoken.php:46
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&#39;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.
language handling
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 ...