ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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  {
116  $genericFeedbackTestPresentationHTML = $this->getPageObjectContent(
118  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
119  );
120  }
121  else
122  {
123  $genericFeedbackTestPresentationHTML = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
124  }
125 
126  return $genericFeedbackTestPresentationHTML;
127  }
128 
139  abstract public function getSpecificAnswerFeedbackTestPresentation($questionId, $answerIndex);
140 
150  {
152  $this->lng->txt('feedback_complete_solution'), 'feedback_complete',
153  $this->questionOBJ->isAdditionalContentEditingModePageObject()
154  ));
155 
157  $this->lng->txt('feedback_incomplete_solution'), '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  {
184  $pageObjectType = $this->getGenericFeedbackPageObjectType();
185 
186  $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
187  $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
188  );
189 
190  $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
191  $pageObjectType, $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
192  );
193  }
194  else
195  {
196  $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
197  $this->questionOBJ->getId(), true
198  );
199 
200  $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
201  $this->questionOBJ->getId(), false
202  );
203  }
204 
205  $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
206  $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
207  }
208 
217  abstract public function initSpecificFormProperties(ilPropertyFormGUI $form);
218 
227  final public function saveGenericFormProperties(ilPropertyFormGUI $form)
228  {
229  if( !$this->questionOBJ->isAdditionalContentEditingModePageObject() )
230  {
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  {
277  require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
278 
279  $property = new ilNonEditableValueGUI($label, $postVar, true);
280  }
281  else
282  {
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  {
293  $property->setUseRte(true);
294  $property->addPlugin("latex");
295  $property->addButton("latex");
296  $property->addButton("pastelatex");
297 
298  require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
299  $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
300  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
301  }
302  else
303  {
304  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
306  $property->setUseTagsForRteOnly(false);
307  }
308 
309  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
310  }
311 
312  return $property;
313  }
314 
326  final public function getGenericFeedbackContent($questionId, $solutionCompleted)
327  {
328  require_once 'Services/RTE/classes/class.ilRTE.php';
329 
330  $correctness = $solutionCompleted ? 1 : 0;
331 
332  $res = $this->db->queryF(
333  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
334  array('integer', 'text'), array($questionId, $correctness)
335  );
336 
337  $feedbackContent = null;
338 
339  while( $row = $this->db->fetchAssoc($res) )
340  {
341  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($row['feedback'], 1);
342  break;
343  }
344 
345  return $feedbackContent;
346  }
347 
357  abstract public function getSpecificAnswerFeedbackContent($questionId, $answerIndex);
358 
367  abstract public function getAllSpecificAnswerFeedbackContents($questionId);
368 
381  final public function saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent)
382  {
383  require_once 'Services/RTE/classes/class.ilRTE.php';
384 
385  $correctness = $solutionCompleted ? 1 : 0;
386 
387  $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
388 
389  if( strlen($feedbackContent) )
390  {
391  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
392  }
393 
394  if( $feedbackId )
395  {
396  $this->db->update(
398  array(
399  'feedback' => array('clob', $feedbackContent),
400  'tstamp' => array('integer', time())
401  ),
402  array(
403  'feedback_id' => array('integer', $feedbackId)
404  )
405  );
406  }
407  else
408  {
409  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
410 
411  $this->db->insert($this->getGenericFeedbackTableName(), array(
412  'feedback_id' => array('integer', $feedbackId),
413  'question_fi' => array('integer', $questionId),
414  'correctness' => array('text', $correctness), // text ?
415  'feedback' => array('clob', $feedbackContent),
416  'tstamp' => array('integer', time())
417  ));
418  }
419 
420  return $feedbackId;
421  }
422 
433  abstract public function saveSpecificAnswerFeedbackContent($questionId, $answerIndex, $feedbackContent);
434 
444  final public function deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
445  {
446  if( $isAdditionalContentEditingModePageObject )
447  {
450  $this->getGenericFeedbackPageObjectId($questionId, true)
451  );
452 
455  $this->getGenericFeedbackPageObjectId($questionId, false)
456  );
457  }
458 
459  $this->db->manipulateF(
460  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($questionId)
461  );
462  }
463 
472  abstract public function deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject);
473 
483  final public function duplicateFeedback($originalQuestionId, $duplicateQuestionId)
484  {
485  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
486  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
487  }
488 
498  final private function duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
499  {
500  $res = $this->db->queryF(
501  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
502  array('integer'), array($originalQuestionId)
503  );
504 
505  while( $row = $this->db->fetchAssoc($res) )
506  {
507  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
508 
509  $this->db->insert($this->getGenericFeedbackTableName(), array(
510  'feedback_id' => array('integer', $feedbackId),
511  'question_fi' => array('integer', $duplicateQuestionId),
512  'correctness' => array('text', $row['correctness']),
513  'feedback' => array('clob', $row['feedback']),
514  'tstamp' => array('integer', time())
515  ));
516 
517  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
518  {
519  $pageObjectType = $this->getGenericFeedbackPageObjectType();
520  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
521  }
522  }
523  }
524 
534  abstract protected function duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
535 
544  final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
545  {
546  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
547  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
548  }
549 
558  final private function syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
559  {
560  // delete generic feedback of the original question
561  $this->db->manipulateF(
562  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($originalQuestionId)
563  );
564 
565  // get generic feedback of the actual (duplicated) question
566  $result = $this->db->queryF(
567  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s", array('integer'), array($duplicateQuestionId)
568  );
569 
570  // save generic feedback to the original question
571  while( $row = $this->db->fetchAssoc($result) )
572  {
573  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
574 
575  $this->db->insert($this->getGenericFeedbackTableName(), array(
576  'feedback_id' => array('integer', $nextId),
577  'question_fi' => array('integer', $originalQuestionId),
578  'correctness' => array('text', $row['correctness']),
579  'feedback' => array('clob', $row['feedback']),
580  'tstamp' => array('integer', time())
581  ));
582  }
583  }
584 
594  final protected function getGenericFeedbackId($questionId, $solutionCompleted)
595  {
596  $res = $this->db->queryF(
597  "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
598  array('integer','text'), array($questionId, (int)$solutionCompleted)
599  );
600 
601  $feedbackId = null;
602 
603  while( $row = $this->db->fetchAssoc($res) )
604  {
605  $feedbackId = $row['feedback_id'];
606  break;
607  }
608 
609  return $feedbackId;
610  }
611 
620  abstract protected function syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
621 
628  final protected function getGenericFeedbackTableName()
629  {
630  return self::TABLE_NAME_GENERIC_FEEDBACK;
631  }
632 
643  final protected function getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
644  {
645  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
646  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
647 
648  return "$link<br /><br />$content";
649  }
650 
657  function getClassNameByType($a_type, $a_gui = false)
658  {
659  $gui = ($a_gui)
660  ? "GUI"
661  : "";
662  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
664  {
665  return "ilAssGenFeedbackPage".$gui;
666  }
668  {
669  return "ilAssSpecFeedbackPage".$gui;
670  }
671  }
672 
673 
684  final private function getPageObjectEditingLink($pageObjectType, $pageObjectId)
685  {
686  $cl = $this->getClassNameByType($pageObjectType, true);
687  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
688  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
689 
690  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
691  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
692 
693  return "<a href='$linkHREF'>$linkTEXT</a>";
694  }
695 
701  final public function setPageObjectOutputMode($a_val)
702  {
703  $this->page_obj_output_mode = $a_val;
704  }
705 
711  final public function getPageObjectOutputMode()
712  {
714  }
715 
725  final protected function getPageObjectContent($pageObjectType, $pageObjectId)
726  {
727  global $ilCtrl;
728 
729  $cl = $this->getClassNameByType($pageObjectType, true);
730  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
731 
732  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
733 
734  $mode = ($ilCtrl->isAsynch())
735  ? "presentation"
736  : $this->getPageObjectOutputMode();
737 
738  $pageObjectGUI = new $cl($pageObjectId);
739  $pageObjectGUI->setOutputMode($mode);
740 
741  return $pageObjectGUI->presentation($mode);
742  }
743 
753  final protected function getPageObjectXML($pageObjectType, $pageObjectId)
754  {
755  $cl = $this->getClassNameByType($pageObjectType);
756  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
757 
758  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
759 
760  $pageObject = new $cl($pageObjectId);
761  return $pageObject->getXMLContent();
762  }
763 
772  final private function ensurePageObjectExists($pageObjectType, $pageObjectId)
773  {
775  {
776  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
777  if( !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
778  {
779  $pageObject = new ilAssGenFeedbackPage();
780  $pageObject->setParentId($this->questionOBJ->getId());
781  $pageObject->setId($pageObjectId);
782  $pageObject->createFromXML();
783  }
784  }
786  {
787  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
788  if( !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
789  {
790  $pageObject = new ilAssSpecFeedbackPage();
791  $pageObject->setParentId($this->questionOBJ->getId());
792  $pageObject->setId($pageObjectId);
793  $pageObject->createFromXML();
794  }
795  }
796  }
797 
808  final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
809  {
810  $cl = $this->getClassNameByType($pageObjectType);
811  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
812 
813  $pageObject = new $cl();
814  $pageObject->setParentId($this->questionOBJ->getId());
815  $pageObject->setId($pageObjectId);
816  $pageObject->setXMLContent($pageObjectContent);
817  $pageObject->createFromXML();
818  }
819 
831  final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
832  {
833  $cl = $this->getClassNameByType($pageObjectType);
834  require_once 'Modules/TestQuestionPool/classes/feedback/class.'.$cl.'.php';
835 
836  $pageObject = new $cl($originalPageObjectId);
837  $pageObject->setParentId($duplicatePageObjectParentId);
838  $pageObject->setId($duplicatePageObjectId);
839  $pageObject->createFromXML();
840  }
841 
850  final protected function ensurePageObjectDeleted($pageObjectType, $pageObjectId)
851  {
853  {
854  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
855  if( ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId) )
856  {
857  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
858  $pageObject->delete();
859  }
860  }
862  {
863  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
864  if( ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId) )
865  {
866  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
867  $pageObject->delete();
868  }
869  }
870  }
871 
880  final protected function getGenericFeedbackPageObjectType()
881  {
882  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
883  }
884 
893  final protected function getSpecificAnswerFeedbackPageObjectType()
894  {
895  return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
896  }
897 
908  final public static function isValidFeedbackPageObjectType($feedbackPageObjectType)
909  {
910  switch( $feedbackPageObjectType )
911  {
912  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
913  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
914 
915  return true;
916  }
917 
918  return false;
919  }
920 
932  final protected function getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
933  {
934  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
935 
936  if( !$pageObjectId )
937  {
938  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
939  }
940 
941  return $pageObjectId;
942  }
943 
953  public function getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
954  {
955  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
956  {
957  $genericFeedbackExportPresentation = $this->getPageObjectXML(
959  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
960  );
961  }
962  else
963  {
964  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
965  }
966 
967  return $genericFeedbackExportPresentation;
968  }
969 
980  abstract public function getSpecificAnswerFeedbackExportPresentation($questionId, $answerIndex);
981 
991  public function importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
992  {
993  if( $this->questionOBJ->isAdditionalContentEditingModePageObject() )
994  {
995  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
996  $pageObjectType = $this->getGenericFeedbackPageObjectType();
997 
998  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
999  }
1000  else
1001  {
1002  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
1003  }
1004  }
1005 
1016  abstract public function importSpecificAnswerFeedback($questionId, $answerIndex, $feedbackContent);
1017 
1022  public function migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
1023  {
1024  $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
1025  $this->getGenericFeedbackContent($questionId, true)
1026  ));
1027 
1028  $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
1029  $this->getGenericFeedbackContent($questionId, false)
1030  ));
1031  }
1032 }
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.
initSpecificFormProperties(ilPropertyFormGUI $form)
initialises a given form object&#39;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...
getItemByPostVar($a_post_var)
Get Item by POST variable.
$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 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 ...
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.
global $ilCtrl
Definition: ilias.php:18
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
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...
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 ...
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. ...
Database Wrapper.
Definition: class.ilDB.php:28
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&#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.
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 ...