ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAssQuestionFeedback.php
Go to the documentation of this file.
1 <?php
2 
29 abstract class ilAssQuestionFeedback
30 {
31  public const CSS_CLASS_FEEDBACK_CORRECT = 'ilc_qfeedr_FeedbackRight';
32  public const CSS_CLASS_FEEDBACK_WRONG = 'ilc_qfeedw_FeedbackWrong';
33 
37  public const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK = 'qfbg';
38 
42  public const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK = 'qfbs';
43 
48 
53 
54  public const TABLE_NAME_GENERIC_FEEDBACK = 'qpl_fb_generic';
55 
57 
58  protected ilCtrl $ctrl;
59 
60  protected ilDBInterface $db;
61 
62  protected ilLanguage $lng;
63 
64  protected string $page_obj_output_mode = "presentation";
65 
76  final public function __construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
77  {
78  $this->questionOBJ = $questionOBJ;
79  $this->ctrl = $ctrl;
80  $this->lng = $lng;
81  $this->db = $db;
82  }
83 
88  public function getGenericFeedbackTestPresentation(int $questionId, bool $solutionCompleted): string
89  {
90  if ($this->page_obj_output_mode == "edit") {
91  return '';
92  }
93  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
94  return $this->cleanupPageContent(
95  $this->getPageObjectContent(
97  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
98  )
99  );
100  }
101  return $this->getGenericFeedbackContent($questionId, $solutionCompleted);
102  }
103 
115  abstract public function getSpecificAnswerFeedbackTestPresentation(int $questionId, int $questionIndex, int $answerIndex): string;
116 
121  final public function completeGenericFormProperties(ilPropertyFormGUI $form): void
122  {
124  $this->lng->txt('feedback_complete_solution'),
125  'feedback_complete',
126  $this->questionOBJ->isAdditionalContentEditingModePageObject()
127  ));
128 
130  $this->lng->txt('feedback_incomplete_solution'),
131  'feedback_incomplete',
132  $this->questionOBJ->isAdditionalContentEditingModePageObject()
133  ));
134  }
135 
144  abstract public function completeSpecificFormProperties(ilPropertyFormGUI $form): void;
145 
150  final public function initGenericFormProperties(ilPropertyFormGUI $form): void
151  {
152  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
153  $pageObjectType = $this->getGenericFeedbackPageObjectType();
154 
155  $valueFeedbackSolutionComplete = $this->getPageObjectNonEditableValueHTML(
156  $pageObjectType,
157  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), true)
158  );
159 
160  $valueFeedbackSolutionIncomplete = $this->getPageObjectNonEditableValueHTML(
161  $pageObjectType,
162  $this->getGenericFeedbackPageObjectId($this->questionOBJ->getId(), false)
163  );
164  } else {
165  $valueFeedbackSolutionComplete = $this->getGenericFeedbackContent(
166  $this->questionOBJ->getId(),
167  true
168  );
169 
170  $valueFeedbackSolutionIncomplete = $this->getGenericFeedbackContent(
171  $this->questionOBJ->getId(),
172  false
173  );
174  }
175 
176  $form->getItemByPostVar('feedback_complete')->setValue($valueFeedbackSolutionComplete);
177  $form->getItemByPostVar('feedback_incomplete')->setValue($valueFeedbackSolutionIncomplete);
178  }
179 
184  abstract public function initSpecificFormProperties(ilPropertyFormGUI $form): void;
185 
190  final public function saveGenericFormProperties(ilPropertyFormGUI $form): void
191  {
192  if (!$this->questionOBJ->isAdditionalContentEditingModePageObject()) {
193  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), false, (string) $form->getInput('feedback_incomplete'));
194  $this->saveGenericFeedbackContent($this->questionOBJ->getId(), true, (string) $form->getInput('feedback_complete'));
195  }
196  }
197 
202  abstract public function saveSpecificFormProperties(ilPropertyFormGUI $form): void;
203 
209  public function isSaveableInPageObjectEditingMode(): bool
210  {
211  return false;
212  }
213 
222  final protected function buildFeedbackContentFormProperty(string $label, string $postVar, bool $asNonEditable): ilSubEnabledFormPropertyGUI
223  {
224  if ($asNonEditable) {
225  $property = new ilNonEditableValueGUI($label, $postVar, true);
226  } else {
227  $property = new ilTextAreaInputGUI($label, $postVar);
228  $property->setRequired(false);
229  $property->setRows(10);
230  $property->setCols(80);
231 
232  if (!$this->questionOBJ->getPreventRteUsage()) {
233  $property->setUseRte(true);
234  $property->addPlugin("latex");
235  $property->addButton("latex");
236  $property->addButton("pastelatex");
237 
238  $property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
239  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
240  } else {
242  $property->setUseTagsForRteOnly(false);
243  }
244 
245  $property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
246  }
247 
248  return $property;
249  }
250 
256  final public function getGenericFeedbackContent(int $questionId, bool $solutionCompleted): string
257  {
258  $res = $this->db->queryF(
259  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
260  array('integer', 'text'),
261  array($questionId, (int) $solutionCompleted)
262  );
263 
264  $feedbackContent = '';
265 
266  if ($this->db->numRows($res) > 0) {
267  $row = $this->db->fetchAssoc($res);
268  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc(
269  $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($row['feedback'] ?? ''),
270  1
271  );
272  }
273  return $feedbackContent;
274  }
275 
276  abstract public function getSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex): string;
277 
278  abstract public function getAllSpecificAnswerFeedbackContents(int $questionId): string;
279 
280  public function isSpecificAnswerFeedbackAvailable(int $questionId): bool
281  {
282  $res = $this->db->queryF(
283  "SELECT answer FROM {$this->getSpecificFeedbackTableName()} WHERE question_fi = %s",
284  ['integer'],
285  [$questionId]
286  );
287 
288  $allFeedbackContents = '';
289 
290  while ($row = $this->db->fetchAssoc($res)) {
291  $allFeedbackContents .= $this->getSpecificAnswerFeedbackExportPresentation(
292  $this->questionOBJ->getId(),
293  0,
294  $row['answer']
295  );
296  }
297 
298  return (bool) strlen(trim(strip_tags($allFeedbackContents)));
299  }
300 
306  final public function saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent): int
307  {
308  require_once 'Services/RTE/classes/class.ilRTE.php';
309 
310  $feedbackId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
311 
312  if (strlen($feedbackContent)) {
313  $feedbackContent = $this->questionOBJ->getHtmlQuestionContentPurifier()->purify($feedbackContent);
314  $feedbackContent = ilRTE::_replaceMediaObjectImageSrc($feedbackContent, 0);
315  }
316 
317  if ($feedbackId != -1) {
318  $this->db->update(
320  array(
321  'feedback' => array('clob', $feedbackContent),
322  'tstamp' => array('integer', time())
323  ),
324  array(
325  'feedback_id' => array('integer', $feedbackId)
326  )
327  );
328  } else {
329  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
330 
331  $this->db->insert($this->getGenericFeedbackTableName(), array(
332  'feedback_id' => array('integer', $feedbackId),
333  'question_fi' => array('integer', $questionId),
334  'correctness' => array('text', (int) $solutionCompleted), // text ?
335  'feedback' => array('clob', $feedbackContent),
336  'tstamp' => array('integer', time())
337  ));
338  }
339 
340  return $feedbackId;
341  }
342 
343  abstract public function saveSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent): int;
344 
349  final public function deleteGenericFeedbacks(int $questionId, bool $isAdditionalContentEditingModePageObject): void
350  {
351  if ($isAdditionalContentEditingModePageObject) {
354  $this->getGenericFeedbackPageObjectId($questionId, true)
355  );
356 
359  $this->getGenericFeedbackPageObjectId($questionId, false)
360  );
361  }
362 
363  $this->db->manipulateF(
364  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
365  array('integer'),
366  array($questionId)
367  );
368  }
369 
370  abstract public function deleteSpecificAnswerFeedbacks(int $questionId, bool $isAdditionalContentEditingModePageObject): void;
371 
376  final public function duplicateFeedback(int $originalQuestionId, int $duplicateQuestionId): void
377  {
378  $this->duplicateGenericFeedback($originalQuestionId, $duplicateQuestionId);
379  $this->duplicateSpecificFeedback($originalQuestionId, $duplicateQuestionId);
380  }
381 
386  private function duplicateGenericFeedback(int $originalQuestionId, int $duplicateQuestionId): void
387  {
388  $res = $this->db->queryF(
389  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
390  array('integer'),
391  array($originalQuestionId)
392  );
393 
394  while ($row = $this->db->fetchAssoc($res)) {
395  $feedbackId = $this->db->nextId($this->getGenericFeedbackTableName());
396 
397  $this->db->insert($this->getGenericFeedbackTableName(), array(
398  'feedback_id' => array('integer', $feedbackId),
399  'question_fi' => array('integer', $duplicateQuestionId),
400  'correctness' => array('text', $row['correctness']),
401  'feedback' => array('clob', $row['feedback']),
402  'tstamp' => array('integer', time())
403  ));
404 
405  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
406  $pageObjectType = $this->getGenericFeedbackPageObjectType();
407  $this->duplicatePageObject($pageObjectType, $row['feedback_id'], $feedbackId, $duplicateQuestionId);
408  }
409  }
410  }
411 
416  abstract protected function duplicateSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId): void;
417 
421  final public function syncFeedback(int $originalQuestionId, int $duplicateQuestionId): void
422  {
423  $this->syncGenericFeedback($originalQuestionId, $duplicateQuestionId);
424  $this->syncSpecificFeedback($originalQuestionId, $duplicateQuestionId);
425  }
426 
430  private function syncGenericFeedback(int $originalQuestionId, int $duplicateQuestionId): void
431  {
432  // delete generic feedback of the original question
433  $this->db->manipulateF(
434  "DELETE FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
435  array('integer'),
436  array($originalQuestionId)
437  );
438 
439  // get generic feedback of the actual (duplicated) question
440  $result = $this->db->queryF(
441  "SELECT * FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s",
442  array('integer'),
443  array($duplicateQuestionId)
444  );
445 
446  // save generic feedback to the original question
447  while ($row = $this->db->fetchAssoc($result)) {
448  $nextId = $this->db->nextId($this->getGenericFeedbackTableName());
449 
450  $this->db->insert($this->getGenericFeedbackTableName(), array(
451  'feedback_id' => array('integer', $nextId),
452  'question_fi' => array('integer', $originalQuestionId),
453  'correctness' => array('text', $row['correctness']),
454  'feedback' => array('clob', $row['feedback']),
455  'tstamp' => array('integer', time())
456  ));
457  }
458  }
459 
463  final protected function getGenericFeedbackId(int $questionId, bool $solutionCompleted): int
464  {
465  $res = $this->db->queryF(
466  "SELECT feedback_id FROM {$this->getGenericFeedbackTableName()} WHERE question_fi = %s AND correctness = %s",
467  array('integer','text'),
468  array($questionId, (int) $solutionCompleted)
469  );
470 
471  $feedbackId = -1;
472  if ($this->db->numRows($res)) {
473  $row = $this->db->fetchAssoc($res);
474  $feedbackId = (int) $row['feedback_id'];
475  }
476 
477  return $feedbackId;
478  }
479 
480  protected function isGenericFeedbackId(int $feedbackId): bool
481  {
482  $row = $this->db->fetchAssoc($this->db->queryF(
483  "SELECT COUNT(feedback_id) cnt FROM {$this->getGenericFeedbackTableName()}
484  WHERE question_fi = %s AND feedback_id = %s",
485  array('integer','integer'),
486  array($this->questionOBJ->getId(), $feedbackId)
487  ));
488 
489 
490  return (bool) $row['cnt'];
491  }
492 
493  abstract protected function isSpecificAnswerFeedbackId(int $feedbackId): bool;
494 
495  final public function checkFeedbackParent(int $feedbackId): bool
496  {
497  if ($this->isGenericFeedbackId($feedbackId)) {
498  return true;
499  }
500 
501  if ($this->isSpecificAnswerFeedbackId($feedbackId)) {
502  return true;
503  }
504 
505  return false;
506  }
507 
511  abstract protected function syncSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId): void;
512 
513  final protected function getGenericFeedbackTableName(): string
514  {
515  return self::TABLE_NAME_GENERIC_FEEDBACK;
516  }
517 
522  final protected function getPageObjectNonEditableValueHTML(string $pageObjectType, int $pageObjectId): string
523  {
524  $link = $this->getPageObjectEditingLink($pageObjectType, $pageObjectId);
525  $content = $this->getPageObjectContent($pageObjectType, $pageObjectId);
526 
527  return "$link<br /><br />$content";
528  }
529 
530  public function getClassNameByType(string $a_type, bool $a_gui = false): string
531  {
532  $gui = ($a_gui) ? "GUI" : "";
533 
535  return "ilAssGenFeedbackPage" . $gui;
536  }
537 
538  //if ($a_type == ilAssQuestionFeedback::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK) {
539  return "ilAssSpecFeedbackPage" . $gui;
540  }
541 
542  private function getPageObjectEditingLink(string $pageObjectType, int $pageObjectId): string
543  {
544  $cl = $this->getClassNameByType($pageObjectType, true);
545  $this->ctrl->setParameterByClass($cl, 'feedback_type', $pageObjectType);
546  $this->ctrl->setParameterByClass($cl, 'feedback_id', $pageObjectId);
547 
548  $linkHREF = $this->ctrl->getLinkTargetByClass($cl, 'edit');
549  $linkTEXT = $this->lng->txt('tst_question_feedback_edit_page');
550 
551  return "<a href='$linkHREF'>$linkTEXT</a>";
552  }
553 
554  final public function setPageObjectOutputMode(string $page_obj_output_mode): void
555  {
556  $this->page_obj_output_mode = $page_obj_output_mode;
557  }
558 
559  final public function getPageObjectOutputMode(): string
560  {
562  }
563 
564  final protected function getPageObjectContent(string $pageObjectType, int $pageObjectId): string
565  {
566  $cl = $this->getClassNameByType($pageObjectType, true);
567 
568  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
569 
570  $mode = ($this->ctrl->isAsynch()) ? "presentation" : $this->getPageObjectOutputMode();
571 
572  $pageObjectGUI = new $cl($pageObjectId);
573  $pageObjectGUI->setOutputMode($mode);
574 
575  return $pageObjectGUI->presentation($mode);
576  }
577 
578  final protected function getPageObjectXML(string $pageObjectType, int $pageObjectId): string
579  {
580  $cl = $this->getClassNameByType($pageObjectType);
581 
582  $this->ensurePageObjectExists($pageObjectType, $pageObjectId);
583 
584  $pageObject = new $cl($pageObjectId);
585  return $pageObject->getXMLContent();
586  }
587 
588  private function ensurePageObjectExists(string $pageObjectType, int $pageObjectId): void
589  {
591  && !ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
592  $pageObject = new ilAssGenFeedbackPage();
593  $pageObject->setParentId($this->questionOBJ->getId());
594  $pageObject->setId($pageObjectId);
595  $pageObject->createFromXML();
596  }
598  && !ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId, '', true)) {
599  $pageObject = new ilAssSpecFeedbackPage();
600  $pageObject->setParentId($this->questionOBJ->getId());
601  $pageObject->setId($pageObjectId);
602  $pageObject->createFromXML();
603  }
604  }
605 
606  final protected function createPageObject(string $pageObjectType, int $pageObjectId, string $pageObjectContent): void
607  {
608  $cl = $this->getClassNameByType($pageObjectType);
609 
610  $pageObject = new $cl();
611  $pageObject->setParentId($this->questionOBJ->getId());
612  $pageObject->setId($pageObjectId);
613  $pageObject->setXMLContent($pageObjectContent);
614  $pageObject->createFromXML();
615  }
616 
617  final protected function duplicatePageObject(string $pageObjectType, int $originalPageObjectId, int $duplicatePageObjectId, int $duplicatePageObjectParentId): void
618  {
619  $this->ensurePageObjectExists($pageObjectType, $originalPageObjectId);
620 
621  $cl = $this->getClassNameByType($pageObjectType);
622 
623  $pageObject = new $cl($originalPageObjectId);
624  $pageObject->setParentId($duplicatePageObjectParentId);
625  $pageObject->setId($duplicatePageObjectId);
626  $pageObject->createFromXML();
627  }
628 
629  final protected function ensurePageObjectDeleted(string $pageObjectType, int $pageObjectId): void
630  {
632  if (ilAssGenFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
633  $pageObject = new ilAssGenFeedbackPage($pageObjectId);
634  $pageObject->delete();
635  }
636  }
638  if (ilAssSpecFeedbackPage::_exists($pageObjectType, $pageObjectId)) {
639  $pageObject = new ilAssSpecFeedbackPage($pageObjectId);
640  $pageObject->delete();
641  }
642  }
643  }
644 
645  final protected function getGenericFeedbackPageObjectType(): string
646  {
647  return self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK;
648  }
649 
650  final protected function getSpecificAnswerFeedbackPageObjectType(): string
651  {
652  return self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK;
653  }
654 
659  final public static function isValidFeedbackPageObjectType(string $feedbackPageObjectType): bool
660  {
661  switch ($feedbackPageObjectType) {
662  case self::PAGE_OBJECT_TYPE_GENERIC_FEEDBACK:
663  case self::PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK:
664  return true;
665  }
666 
667  return false;
668  }
669 
675  final protected function getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted): int
676  {
677  $pageObjectId = $this->getGenericFeedbackId($questionId, $solutionCompleted);
678 
679  if ($pageObjectId == -1) {
680  $pageObjectId = $this->saveGenericFeedbackContent($questionId, $solutionCompleted, '');
681  }
682 
683  return $pageObjectId;
684  }
685 
690  public function getGenericFeedbackExportPresentation(int $questionId, bool $solutionCompleted): string
691  {
692  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
693  $genericFeedbackExportPresentation = $this->getPageObjectXML(
695  $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted)
696  );
697  } else {
698  $genericFeedbackExportPresentation = $this->getGenericFeedbackContent($questionId, $solutionCompleted);
699  }
700 
701  return $genericFeedbackExportPresentation;
702  }
703 
708  abstract public function getSpecificAnswerFeedbackExportPresentation(int $questionId, int $questionIndex, int $answerIndex): string;
709 
714  public function importGenericFeedback(int $questionId, bool $solutionCompleted, string $feedbackContent): void
715  {
716  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
717  $pageObjectId = $this->getGenericFeedbackPageObjectId($questionId, $solutionCompleted);
718  $pageObjectType = $this->getGenericFeedbackPageObjectType();
719 
720  $this->createPageObject($pageObjectType, $pageObjectId, $feedbackContent);
721  } else {
722  $this->saveGenericFeedbackContent($questionId, $solutionCompleted, $feedbackContent);
723  }
724  }
725 
726  abstract public function importSpecificAnswerFeedback(int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent): void;
727 
728  public function migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, int $questionId): void
729  {
730  $this->saveGenericFeedbackContent($questionId, true, $migrator->migrateToLmContent(
731  $this->getGenericFeedbackContent($questionId, true)
732  ));
733 
734  $this->saveGenericFeedbackContent($questionId, false, $migrator->migrateToLmContent(
735  $this->getGenericFeedbackContent($questionId, false)
736  ));
737  }
738 
739  protected function cleanupPageContent(string $content): string
740  {
741  $doc = new DOMDocument('1.0', 'UTF-8');
742  if (@$doc->loadHTML('<html><body>' . $content . '</body></html>')) {
743  $xpath = new DOMXPath($doc);
744  $nodes_after_comments = $xpath->query('//comment()/following-sibling::*[1]');
745  foreach ($nodes_after_comments as $node_after_comments) {
746  if (trim($node_after_comments->nodeValue) === ''
747  && $node_after_comments->childElementCount === 0) {
748  return '';
749  }
750  }
751  }
752  return $content;
753  }
754 }
static _replaceMediaObjectImageSrc(string $a_text, int $a_direction=0, string $nic='')
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
importGenericFeedback(int $questionId, bool $solutionCompleted, string $feedbackContent)
imports the given feedback content as generic feedback for the given question id for either the compl...
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 ...
duplicatePageObject(string $pageObjectType, int $originalPageObjectId, int $duplicatePageObjectId, int $duplicatePageObjectParentId)
syncGenericFeedback(int $originalQuestionId, int $duplicateQuestionId)
syncs the GENERIC feedback from a duplicated question back to the original question ...
$res
Definition: ltiservices.php:69
deleteGenericFeedbacks(int $questionId, bool $isAdditionalContentEditingModePageObject)
deletes all GENERIC feedback contents (and page objects if required) for the given question id ...
importSpecificAnswerFeedback(int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
ensurePageObjectDeleted(string $pageObjectType, int $pageObjectId)
getGenericFeedbackExportPresentation(int $questionId, bool $solutionCompleted)
returns the generic feedback export presentation for given question id either for solution completed ...
getItemByPostVar(string $a_post_var)
duplicateSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId)
duplicates the SPECIFIC feedback relating to the given original question id and saves it for the give...
Abstract basic class which is to be extended by the concrete assessment question type classes...
getPageObjectContent(string $pageObjectType, int $pageObjectId)
__construct(assQuestion $questionOBJ, ilCtrl $ctrl, ilDBInterface $db, ilLanguage $lng)
constructor
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getClassNameByType(string $a_type, bool $a_gui=false)
getAllSpecificAnswerFeedbackContents(int $questionId)
syncSpecificFeedback(int $originalQuestionId, int $duplicateQuestionId)
syncs the SPECIFIC feedback from a duplicated question back to the original question ...
deleteSpecificAnswerFeedbacks(int $questionId, bool $isAdditionalContentEditingModePageObject)
saveSpecificFormProperties(ilPropertyFormGUI $form)
saves a given form object&#39;s SPECIFIC form properties relating to this question type ...
static isValidFeedbackPageObjectType(string $feedbackPageObjectType)
returns the fact whether the given page object type relates to generic or specific feedback page obje...
saveSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex, string $feedbackContent)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSpecificAnswerFeedbackContent(int $questionId, int $questionIndex, int $answerIndex)
getGenericFeedbackPageObjectId(int $questionId, bool $solutionCompleted)
returns a useable page object id for generic feedback page objects for the given question id for eith...
isSpecificAnswerFeedbackId(int $feedbackId)
createPageObject(string $pageObjectType, int $pageObjectId, string $pageObjectContent)
getGenericFeedbackContent(int $questionId, bool $solutionCompleted)
returns the GENERIC feedback content for a given question state.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
const PAGE_OBJECT_TYPE_GENERIC_FEEDBACK
type for generic feedback page objects
getPageObjectXML(string $pageObjectType, int $pageObjectId)
isSpecificAnswerFeedbackAvailable(int $questionId)
getSpecificAnswerFeedbackExportPresentation(int $questionId, int $questionIndex, int $answerIndex)
returns the generic feedback export presentation for given question id either for solution completed ...
buildFeedbackContentFormProperty(string $label, string $postVar, bool $asNonEditable)
builds and returns a form property gui object with the given label and postvar that is addable to pro...
duplicateFeedback(int $originalQuestionId, int $duplicateQuestionId)
duplicates the feedback relating to the given original question id and saves it for the given duplica...
getPageObjectNonEditableValueHTML(string $pageObjectType, int $pageObjectId)
returns html content to be used as value for non editable value form properties in feedback editing f...
getGenericFeedbackTestPresentation(int $questionId, bool $solutionCompleted)
returns the html of GENERIC feedback for the given question id for test presentation (either for the ...
getGenericFeedbackId(int $questionId, bool $solutionCompleted)
returns the SPECIFIC answer feedback ID for a given question id and answer index. ...
const FEEDBACK_SOLUTION_INCOMPLETE_PAGE_OBJECT_ID
id for page object relating to generic incomplete solution feedback
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
syncFeedback(int $originalQuestionId, int $duplicateQuestionId)
syncs the feedback from a duplicated question back to the original question
isSaveableInPageObjectEditingMode()
returns the fact wether the feedback editing form is saveable in page object editing or not...
getSpecificAnswerFeedbackTestPresentation(int $questionId, int $questionIndex, int $answerIndex)
returns the html of SPECIFIC feedback for the given question id and answer index for test presentatio...
saveGenericFormProperties(ilPropertyFormGUI $form)
saves a given form object&#39;s GENERIC form properties relating to all question types ...
const FEEDBACK_SOLUTION_COMPLETE_PAGE_OBJECT_ID
id for page object relating to generic complete solution feedback
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ensurePageObjectExists(string $pageObjectType, int $pageObjectId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
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 ...
duplicateGenericFeedback(int $originalQuestionId, int $duplicateQuestionId)
duplicates the GENERIC feedback relating to the given original question id and saves it for the given...
saveGenericFeedbackContent(int $questionId, bool $solutionCompleted, string $feedbackContent)
saves GENERIC feedback content for the given question id to the database.
migrateContentForLearningModule(ilAssSelfAssessmentMigrator $migrator, int $questionId)
setPageObjectOutputMode(string $page_obj_output_mode)
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
const PAGE_OBJECT_TYPE_SPECIFIC_FEEDBACK
type for specific feedback page objects
getPageObjectEditingLink(string $pageObjectType, int $pageObjectId)