ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $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 = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
397  }
398 
399  if ($feedbackId) {
400  $this->db->update(
402  array(
403  'feedback' => array('clob', $feedbackContent),
404  'tstamp' => array('integer', time())
405  ),
406  array(
407  'feedback_id' => array('integer', $feedbackId)
408  )
409  );
410  } else {
411  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
412 
413  $this->db->insert($this->getGenericFeedbackTableName(), array(
414  'feedback_id' => array('integer', $feedbackId),
415  'question_fi' => array('integer', $questionId),
416  'correctness' => array('text', $correctness), // text ?
417  'feedback' => array('clob', $feedbackContent),
418  'tstamp' => array('integer', time())
419  ));
420  }
421 
422  return $feedbackId;
423  }
424 
436  abstract public function saveSpecificAnswerFeedbackContent($questionId, $questionIndex, $answerIndex, $feedbackContent);
437 
447  final public function deleteGenericFeedbacks($questionId, $isAdditionalContentEditingModePageObject)
448  {
449  if ($isAdditionalContentEditingModePageObject) {
452  $this->getGenericFeedbackPageObjectId($questionId, true)
453  );
454 
457  $this->getGenericFeedbackPageObjectId($questionId, false)
458  );
459  }
460 
461  $this->db->manipulateF(
462  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
463  array('integer'),
464  array($questionId)
465  );
466  }
467 
476  abstract public function deleteSpecificAnswerFeedbacks($questionId, $isAdditionalContentEditingModePageObject);
477 
487  final public function duplicateFeedback($originalQuestionId, $duplicateQuestionId)
488  {
489  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
490  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
491  }
492 
502  final private function duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
503  {
504  $res = $this->db->queryF(
505  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
506  array('integer'),
507  array($originalQuestionId)
508  );
509 
510  while ($row = $this->db->fetchAssoc($res)) {
511  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
512 
513  $this->db->insert($this->getGenericFeedbackTableName(), array(
514  'feedback_id' => array('integer', $feedbackId),
515  'question_fi' => array('integer', $duplicateQuestionId),
516  'correctness' => array('text', $row['correctness']),
517  'feedback' => array('clob', $row['feedback']),
518  'tstamp' => array('integer', time())
519  ));
520 
521  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
522  $pageObjectType = $this->getGenericFeedbackPageObjectType();
523  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
524  }
525  }
526  }
527 
537  abstract protected function duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
538 
547  final public function syncFeedback($originalQuestionId, $duplicateQuestionId)
548  {
549  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
550  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
551  }
552 
561  final private function syncGenericFeedback($originalQuestionId, $duplicateQuestionId)
562  {
563  // delete generic feedback of the original question
564  $this->db->manipulateF(
565  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
566  array('integer'),
567  array($originalQuestionId)
568  );
569 
570  // get generic feedback of the actual (duplicated) question
571  $result = $this->db->queryF(
572  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
573  array('integer'),
574  array($duplicateQuestionId)
575  );
576 
577  // save generic feedback to the original question
578  while ($row = $this->db->fetchAssoc($result)) {
579  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
580 
581  $this->db->insert($this->getGenericFeedbackTableName(), array(
582  'feedback_id' => array('integer', $nextId),
583  'question_fi' => array('integer', $originalQuestionId),
584  'correctness' => array('text', $row['correctness']),
585  'feedback' => array('clob', $row['feedback']),
586  'tstamp' => array('integer', time())
587  ));
588  }
589  }
590 
600  final protected function getGenericFeedbackId($questionId, $solutionCompleted)
601  {
602  $res = $this->db->queryF(
603  "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
604  array('integer','text'),
605  array($questionId, (int) $solutionCompleted)
606  );
607 
608  $feedbackId = null;
609 
610  while ($row = $this->db->fetchAssoc($res)) {
611  $feedbackId = $row['feedback_id'];
612  break;
613  }
614 
615  return $feedbackId;
616  }
617 
622  protected function isGenericFeedbackId($feedbackId)
623  {
624  $row = $this->db->fetchAssoc($this->db->queryF(
625  "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()}
626  WHERE question_fi = %s AND feedback_id = %s",
627  array('integer','integer'),
628  array($this->questionOBJ->getId(), $feedbackId)
629  ));
630 
631 
632  return $row['cnt'];
633  }
634 
639  abstract protected function isSpecificAnswerFeedbackId($feedbackId);
640 
645  final public function checkFeedbackParent($feedbackId)
646  {
647  if ($this->isGenericFeedbackId($feedbackId)) {
648  return true;
649  }
650 
651  if ($this->isSpecificAnswerFeedbackId($feedbackId)) {
652  return true;
653  }
654 
655  return false;
656  }
657 
666  abstract protected function syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
667 
674  final protected function getGenericFeedbackTableName()
675  {
676  return self::TABLE_NAME_GENERIC_FEEDBACK;
677  }
678 
689  final protected function getPageObjectNonEditableValueHTML($pageObjectType, $pageObjectId)
690  {
691  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
692  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
693 
694  return "$link<br /><br />$content";
695  }
696 
703  public function getClassNameByType($a_type, $a_gui = false)
704  {
705  $gui = ($a_gui)
706  ? "GUI"
707  : "";
708  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssQuestionFeedback.php");
710  return "ilAssGenFeedbackPage" . $gui;
711  }
713  return "ilAssSpecFeedbackPage" . $gui;
714  }
715  }
716 
717 
728  final private function getPageObjectEditingLink($pageObjectType, $pageObjectId)
729  {
730  $cl = $this->getClassNameByType($pageObjectType, true);
731  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
732  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
733 
734  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
735  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
736 
737  return "<a href='$linkHREF'>$linkTEXT</a>";
738  }
739 
745  final public function setPageObjectOutputMode($a_val)
746  {
747  $this->page_obj_output_mode = $a_val;
748  }
749 
755  final public function getPageObjectOutputMode()
756  {
758  }
759 
769  final protected function getPageObjectContent($pageObjectType, $pageObjectId)
770  {
771  global $DIC;
772  $ilCtrl = $DIC['ilCtrl'];
773 
774  $cl = $this->getClassNameByType($pageObjectType, true);
775  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
776 
777  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
778 
779  $mode = ($ilCtrl->isAsynch())
780  ? "presentation"
781  : $this->getPageObjectOutputMode();
782 
783  $pageObjectGUI = new $cl($pageObjectId);
784  $pageObjectGUI->setOutputMode($mode);
785 
786  return $pageObjectGUI->presentation($mode);
787  }
788 
798  final protected function getPageObjectXML($pageObjectType, $pageObjectId)
799  {
800  $cl = $this->getClassNameByType($pageObjectType);
801  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
802 
803  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
804 
805  $pageObject = new $cl($pageObjectId);
806  return $pageObject->getXMLContent();
807  }
808 
817  final private function ensurePageObjectExists($pageObjectType, $pageObjectId)
818  {
820  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
821  if (!ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
822  $pageObject = new ilAssGenFeedbackPage();
823  $pageObject->setParentId($this->questionOBJ->getId());
824  $pageObject->setId($pageObjectId);
825  $pageObject->createFromXML();
826  }
827  }
829  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
830  if (!ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
831  $pageObject = new ilAssSpecFeedbackPage();
832  $pageObject->setParentId($this->questionOBJ->getId());
833  $pageObject->setId($pageObjectId);
834  $pageObject->createFromXML();
835  }
836  }
837  }
838 
849  final protected function createPageObject($pageObjectType, $pageObjectId, $pageObjectContent)
850  {
851  $cl = $this->getClassNameByType($pageObjectType);
852  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
853 
854  $pageObject = new $cl();
855  $pageObject->setParentId($this->questionOBJ->getId());
856  $pageObject->setId($pageObjectId);
857  $pageObject->setXMLContent($pageObjectContent);
858  $pageObject->createFromXML();
859  }
860 
872  final protected function duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
873  {
874  $cl = $this->getClassNameByType($pageObjectType);
875  require_once 'Modules/TestQuestionPool/classes/feedback/class.' . $cl . '.php';
876 
877  $pageObject = new $cl($originalPageObjectId);
878  $pageObject->setParentId($duplicatePageObjectParentId);
879  $pageObject->setId($duplicatePageObjectId);
880  $pageObject->createFromXML();
881  }
882 
891  final protected function ensurePageObjectDeleted($pageObjectType, $pageObjectId)
892  {
894  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPage.php");
895  if (ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
896  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
897  $pageObject->delete();
898  }
899  }
901  include_once("./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPage.php");
902  if (ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
903  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
904  $pageObject->delete();
905  }
906  }
907  }
908 
917  final protected function getGenericFeedbackPageObjectType()
918  {
919  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
920  }
921 
930  final protected function getSpecificAnswerFeedbackPageObjectType()
931  {
932  return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
933  }
934 
945  final public static function isValidFeedbackPageObjectType($feedbackPageObjectType)
946  {
947  switch ($feedbackPageObjectType) {
948  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
949  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
950 
951  return true;
952  }
953 
954  return false;
955  }
956 
968  final protected function getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
969  {
970  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
971 
972  if (!$pageObjectId) {
973  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, null);
974  }
975 
976  return $pageObjectId;
977  }
978 
988  public function getGenericFeedbackExportPresentation($questionId, $solutionCompleted)
989  {
990  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
991  $genericFeedbackExportPresentation = $this->getPageObjectXML(
993  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
994  );
995  } else {
996  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
997  }
998 
999  return $genericFeedbackExportPresentation;
1000  }
1001 
1013  abstract public function getSpecificAnswerFeedbackExportPresentation($questionId, $questionIndex, $answerIndex);
1014 
1024  public function importGenericFeedback($questionId, $solutionCompleted, $feedbackContent)
1025  {
1026  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
1027  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
1028  $pageObjectType = $this->getGenericFeedbackPageObjectType();
1029 
1030  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
1031  } else {
1032  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
1033  }
1034  }
1035 
1047  abstract public function importSpecificAnswerFeedback($questionId, $questionIndex, $answerIndex, $feedbackContent);
1048 
1053  public function migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, $questionId)
1054  {
1055  $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
1056  $this->getGenericFeedbackContent($questionId, true)
1057  ));
1058 
1059  $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
1060  $this->getGenericFeedbackContent($questionId, false)
1061  ));
1062  }
1063 }
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.
global $DIC
Definition: saml.php:7
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
$a_type
Definition: workflow.php:92
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
syncSpecificFeedback($originalQuestionId, $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...
const TABLE_NAME_GENERIC_FEEDBACK
table name for specific feedback
duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
duplicatePageObject($pageObjectType, $originalPageObjectId, $duplicatePageObjectId, $duplicatePageObjectParentId)
duplicates the page object with given type and original id to new page object with same type and give...
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
$row
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...
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 ...