ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAssQuestionHintsGUI.php
Go to the documentation of this file.
1 <?php
2 
19 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintAbstractGUI.php';
20 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
21 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsOrderingClipboard.php';
22 
38 {
42  public const CMD_SHOW_LIST = 'showList';
43  public const CMD_SHOW_HINT = 'showHint';
44  public const CMD_CONFIRM_DELETE = 'confirmDelete';
45  public const CMD_PERFORM_DELETE = 'performDelete';
46  public const CMD_SAVE_LIST_ORDER = 'saveListOrder';
47  public const CMD_CUT_TO_ORDERING_CLIPBOARD = 'cutToOrderingClipboard';
48  public const CMD_PASTE_FROM_ORDERING_CLIPBOARD_BEFORE = 'pasteFromOrderingClipboardBefore';
49  public const CMD_PASTE_FROM_ORDERING_CLIPBOARD_AFTER = 'pasteFromOrderingClipboardAfter';
50  public const CMD_RESET_ORDERING_CLIPBOARD = 'resetOrderingClipboard';
51  public const CMD_CONFIRM_SYNC = 'confirmSync';
52 
53  private $hintOrderingClipboard = null;
54  private ilLanguage $lng;
55  private ilCtrl $ctrl;
56 
60  protected $editingEnabled = false;
61  private \ilGlobalTemplateInterface $main_tpl;
62 
70  {
71  global $DIC;
72  $this->main_tpl = $DIC->ui()->mainTemplate();
73  $this->ctrl = $DIC->ctrl();
74  $this->lng = $DIC->language();
75  parent::__construct($questionGUI);
76 
77  $this->hintOrderingClipboard = new ilAssQuestionHintsOrderingClipboard($questionGUI->object);
78  }
79 
83  public function isEditingEnabled(): bool
84  {
85  return $this->editingEnabled;
86  }
87 
91  public function setEditingEnabled(bool $editingEnabled): void
92  {
93  $this->editingEnabled = $editingEnabled;
94  }
95 
96  public function executeCommand(): void
97  {
98  global $DIC;
99  $ilCtrl = $DIC['ilCtrl'];
100  $ilTabs = $DIC['ilTabs'];
101  $lng = $DIC['lng'];
102  global $DIC; /* @var \ILIAS\DI\Container $DIC */
103  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
104  $ilHelp->setScreenIdComponent('qpl');
105 
106  require_once "./Services/Style/Content/classes/class.ilObjStyleSheet.php";
107  $DIC->ui()->mainTemplate()->setCurrentBlock("ContentStyle");
108  $DIC->ui()->mainTemplate()->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
109  $DIC->ui()->mainTemplate()->parseCurrentBlock();
110 
111  $cmd = $ilCtrl->getCmd(self::CMD_SHOW_LIST);
112  $nextClass = $ilCtrl->getNextClass($this);
113 
114  switch ($nextClass) {
115  case 'ilassquestionhintgui':
116 
117  if (!$this->isEditingEnabled()) {
118  return;
119  }
120 
121  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
122  $gui = new ilAssQuestionHintGUI($this->questionGUI);
123  $ilCtrl->forwardCommand($gui);
124  break;
125 
126  case 'ilasshintpagegui':
127 
128  if ($this->isEditingEnabled()) {
130  } else {
132  }
133 
134  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintPageObjectCommandForwarder.php';
135  $forwarder = new ilAssQuestionHintPageObjectCommandForwarder($this->questionOBJ, $ilCtrl, $ilTabs, $lng);
136  $forwarder->setPresentationMode($presentationMode);
137  $forwarder->forward();
138  break;
139 
140  default:
141  $this->tabs->setTabActive('tst_question_hints_tab');
142  $cmd .= 'Cmd';
143  $this->$cmd();
144  break;
145  }
146  }
147 
154  private function showListCmd(): void
155  {
156  global $DIC;
157  $ilCtrl = $DIC['ilCtrl'];
158  $tpl = $DIC['tpl'];
159  $lng = $DIC['lng'];
160 
162 
163  require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
164  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsTableGUI.php';
165 
166  $toolbar = new ilToolbarGUI();
167 
168  $questionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
169 
170  if ($this->isEditingEnabled()) {
171  if ($this->hintOrderingClipboard->hasStored()) {
172  $questionHintList = $this->getQuestionHintListWithoutHintStoredInOrderingClipboard($questionHintList);
173 
174  $toolbar->addButton(
175  $lng->txt('tst_questions_hints_toolbar_cmd_reset_ordering_clipboard'),
176  $ilCtrl->getLinkTarget($this, self::CMD_RESET_ORDERING_CLIPBOARD)
177  );
178  } else {
179  $toolbar->addButton(
180  $lng->txt('tst_questions_hints_toolbar_cmd_add_hint'),
181  $ilCtrl->getLinkTargetByClass('ilAssQuestionHintGUI', ilAssQuestionHintGUI::CMD_SHOW_FORM)
182  );
183  }
184 
186  } else {
188  }
189 
190  $table = new ilAssQuestionHintsTableGUI(
191  $this->questionOBJ,
192  $questionHintList,
193  $this,
194  self::CMD_SHOW_LIST,
195  $tableMode,
196  $this->hintOrderingClipboard
197  );
198 
199  $tpl->setContent($ilCtrl->getHtml($toolbar) . $ilCtrl->getHtml($table));
200  }
201 
210  private function confirmDeleteCmd(): void
211  {
212  global $DIC;
213  $ilCtrl = $DIC['ilCtrl'];
214  $tpl = $DIC['tpl'];
215  $lng = $DIC['lng'];
216 
217  $hintIds = self::fetchHintIdsParameter();
218 
219  if (!count($hintIds)) {
220  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_delete_hints_missing_selection_msg'), true);
221  $ilCtrl->redirect($this);
222  }
223 
224  $confirmation = new ilConfirmationGUI();
225 
226  $confirmation->setHeaderText($lng->txt('tst_question_hints_delete_hints_confirm_header'));
227  $confirmation->setFormAction($ilCtrl->getFormAction($this));
228  $confirmation->setConfirm($lng->txt('tst_question_hints_delete_hints_confirm_cmd'), self::CMD_PERFORM_DELETE);
229  $confirmation->setCancel($lng->txt('cancel'), self::CMD_SHOW_LIST);
230 
231  $questionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
232 
233  foreach ($questionHintList as $questionHint) {
234  /* @var $questionHint ilAssQuestionHint */
235 
236  if (in_array($questionHint->getId(), $hintIds)) {
237  $confirmation->addItem('hint_ids[]', $questionHint->getId(), sprintf(
238  $lng->txt('tst_question_hints_delete_hints_confirm_item'),
239  $questionHint->getIndex(),
240  $questionHint->getText()
241  ));
242  }
243  }
244 
245  $tpl->setContent($ilCtrl->getHtml($confirmation));
246  }
247 
255  private function performDeleteCmd(): void
256  {
257  if (!$this->isEditingEnabled()) {
258  return;
259  }
260 
261  global $DIC;
262  $ilCtrl = $DIC['ilCtrl'];
263  $tpl = $DIC['tpl'];
264  $lng = $DIC['lng'];
265 
266  $hintIds = self::fetchHintIdsParameter();
267 
268  if (!count($hintIds)) {
269  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_delete_hints_missing_selection_msg'), true);
270  $ilCtrl->redirect($this);
271  }
272 
273  $questionCompleteHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
274 
275  $questionRemainingHintList = new ilAssQuestionHintList();
276 
277  foreach ($questionCompleteHintList as $listKey => $questionHint) {
278  /* @var $questionHint ilAssQuestionHint */
279 
280  if (in_array($questionHint->getId(), $hintIds)) {
281  $questionHint->delete();
282  } else {
283  $questionRemainingHintList->addHint($questionHint);
284  }
285  }
286 
287  $questionRemainingHintList->reIndex();
288 
289  $this->main_tpl->setOnScreenMessage('success', $lng->txt('tst_question_hints_delete_success_msg'), true);
290 
291  $originalexists = $this->questionOBJ->_questionExistsInPool((int) $this->questionOBJ->getOriginalId());
292  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
293  global $DIC;
294  $ilUser = $DIC['ilUser'];
295  if ($this->request->raw("calling_test") && $originalexists && assQuestion::_isWriteable($this->questionOBJ->getOriginalId(), $ilUser->getId())) {
296  $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_CONFIRM_SYNC);
297  }
298 
299  $ilCtrl->redirect($this);
300  }
301 
310  private function saveListOrderCmd(): void
311  {
312  if (!$this->isEditingEnabled()) {
313  return;
314  }
315 
316  global $DIC;
317  $ilCtrl = $DIC['ilCtrl'];
318  $lng = $DIC['lng'];
319 
320  $hintIndexes = self::orderHintIndexes(
321  self::fetchHintIndexesParameter()
322  );
323 
324  if (!count($hintIndexes)) {
325  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_save_order_unkown_failure_msg'), true);
326  $ilCtrl->redirect($this);
327  }
328 
329  $curQuestionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
330 
331  $newQuestionHintList = new ilAssQuestionHintList();
332 
333  foreach ($hintIndexes as $hintId => $hintIndex) {
334  if (!$curQuestionHintList->hintExists($hintId)) {
335  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_save_order_unkown_failure_msg'), true);
336  $ilCtrl->redirect($this);
337  }
338 
339  $questionHint = $curQuestionHintList->getHint($hintId);
340 
341  $newQuestionHintList->addHint($questionHint);
342  }
343 
344  $newQuestionHintList->reIndex();
345 
346  $this->main_tpl->setOnScreenMessage('success', $lng->txt('tst_question_hints_save_order_success_msg'), true);
347 
348  $originalexists = $this->questionOBJ->_questionExistsInPool((int) $this->questionOBJ->getOriginalId());
349  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
350  global $DIC;
351  $ilUser = $DIC['ilUser'];
352  if ($this->request->raw("calling_test") && $originalexists && assQuestion::_isWriteable($this->questionOBJ->getOriginalId(), $ilUser->getId())) {
353  $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_CONFIRM_SYNC);
354  }
355 
356  $ilCtrl->redirect($this);
357  }
358 
365  private function cutToOrderingClipboardCmd(): void
366  {
367  if (!$this->isEditingEnabled()) {
368  return;
369  }
370 
371  global $DIC;
372  $ilCtrl = $DIC['ilCtrl'];
373 
374  $moveHintIds = self::fetchHintIdsParameter();
375  $this->checkForSingleHintIdAndRedirectOnFailure($moveHintIds);
376 
377  $moveHintId = current($moveHintIds);
378 
380 
381  $this->hintOrderingClipboard->setStored($moveHintId);
382 
383  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
384  }
385 
393  private function pasteFromOrderingClipboardBeforeCmd(): void
394  {
395  if (!$this->isEditingEnabled()) {
396  return;
397  }
398 
399  global $DIC;
400  $ilCtrl = $DIC['ilCtrl'];
401  $lng = $DIC['lng'];
402 
403  $targetHintIds = self::fetchHintIdsParameter();
404  $this->checkForSingleHintIdAndRedirectOnFailure($targetHintIds);
405 
406  $targetHintId = current($targetHintIds);
407 
409 
410  $curQuestionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
411  $newQuestionHintList = new ilAssQuestionHintList($this->questionOBJ->getId());
412 
413  foreach ($curQuestionHintList as $questionHint) {
414  /* @var $questionHint ilAssQuestionHint */
415 
416  if ($questionHint->getId() == $this->hintOrderingClipboard->getStored()) {
417  continue;
418  }
419 
420  if ($questionHint->getId() == $targetHintId) {
421  $targetQuestionHint = $questionHint;
422 
423  $pasteQuestionHint = ilAssQuestionHint::getInstanceById($this->hintOrderingClipboard->getStored());
424 
425  $newQuestionHintList->addHint($pasteQuestionHint);
426  }
427 
428  $newQuestionHintList->addHint($questionHint);
429  }
430 
431  $successMsg = sprintf(
432  $lng->txt('tst_question_hints_paste_before_success_msg'),
433  $pasteQuestionHint->getIndex(),
434  $targetQuestionHint->getIndex()
435  );
436 
437  $newQuestionHintList->reIndex();
438 
439  $this->hintOrderingClipboard->resetStored();
440 
441  $this->main_tpl->setOnScreenMessage('success', $successMsg, true);
442 
443  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
444  }
445 
453  private function pasteFromOrderingClipboardAfterCmd(): void
454  {
455  if (!$this->isEditingEnabled()) {
456  return;
457  }
458 
459  global $DIC;
460  $ilCtrl = $DIC['ilCtrl'];
461  $lng = $DIC['lng'];
462 
463  $targetHintIds = self::fetchHintIdsParameter();
464  $this->checkForSingleHintIdAndRedirectOnFailure($targetHintIds);
465 
466  $targetHintId = current($targetHintIds);
467 
469 
470  $curQuestionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
471  $newQuestionHintList = new ilAssQuestionHintList($this->questionOBJ->getId());
472 
473  foreach ($curQuestionHintList as $questionHint) {
474  /* @var $questionHint ilAssQuestionHint */
475 
476  if ($questionHint->getId() == $this->hintOrderingClipboard->getStored()) {
477  continue;
478  }
479 
480  $newQuestionHintList->addHint($questionHint);
481 
482  if ($questionHint->getId() == $targetHintId) {
483  $targetQuestionHint = $questionHint;
484 
485  $pasteQuestionHint = ilAssQuestionHint::getInstanceById($this->hintOrderingClipboard->getStored());
486 
487  $newQuestionHintList->addHint($pasteQuestionHint);
488  }
489  }
490 
491  $successMsg = sprintf(
492  $lng->txt('tst_question_hints_paste_after_success_msg'),
493  $pasteQuestionHint->getIndex(),
494  $targetQuestionHint->getIndex()
495  );
496 
497  $newQuestionHintList->reIndex();
498 
499  $this->hintOrderingClipboard->resetStored();
500 
501  $this->main_tpl->setOnScreenMessage('success', $successMsg, true);
502 
503  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
504  }
505 
513  private function resetOrderingClipboardCmd(): void
514  {
515  global $DIC;
516  $ilCtrl = $DIC['ilCtrl'];
517  $lng = $DIC['lng'];
518 
519  $this->hintOrderingClipboard->resetStored();
520 
521  $this->main_tpl->setOnScreenMessage('info', $lng->txt('tst_question_hints_ordering_clipboard_resetted'), true);
522  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
523  }
524 
532  private function initHintOrderingClipboardNotification(): void
533  {
534  global $DIC;
535  $lng = $DIC['lng'];
536 
537  if (!$this->hintOrderingClipboard->hasStored()) {
538  return;
539  }
540 
541  $questionHint = ilAssQuestionHint::getInstanceById($this->hintOrderingClipboard->getStored());
542 
543  $this->main_tpl->setOnScreenMessage('info', sprintf(
544  $lng->txt('tst_question_hints_item_stored_in_ordering_clipboard'),
545  $questionHint->getIndex()
546  ));
547  }
548 
557  {
558  $questionHintList = ilAssQuestionHintList::getListByQuestionId($this->questionOBJ->getId());
559 
560  if (!$questionHintList->hintExists($hintId)) {
561  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('tst_question_hints_invalid_hint_id'), true);
562  $this->ctrl->redirect($this, self::CMD_SHOW_LIST);
563  }
564  }
565 
575  {
576  $filteredQuestionHintList = new ilAssQuestionHintList();
577 
578  foreach ($questionHintList as $questionHint) {
579  /* @var $questionHint ilAssQuestionHint */
580 
581  if ($questionHint->getId() != $this->hintOrderingClipboard->getStored()) {
582  $filteredQuestionHintList->addHint($questionHint);
583  }
584  }
585 
586  return $filteredQuestionHintList;
587  }
588 
598  private function checkForSingleHintIdAndRedirectOnFailure($hintIds): void
599  {
600  global $DIC;
601  $ilCtrl = $DIC['ilCtrl'];
602  $lng = $DIC['lng'];
603 
604  if (!count($hintIds)) {
605  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_cut_hints_missing_selection_msg'), true);
606  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
607  } elseif (count($hintIds) > 1) {
608  $this->main_tpl->setOnScreenMessage('failure', $lng->txt('tst_question_hints_cut_hints_single_selection_msg'), true);
609  $ilCtrl->redirect($this, self::CMD_SHOW_LIST);
610  }
611  }
612 
621  private static function fetchHintIdsParameter(): array
622  {
623  global $DIC;
624  $request = $DIC->testQuestionPool()->internal()->request();
625  $hintIds = array();
626 
627  if (isset($_POST['hint_ids']) && is_array($_POST['hint_ids'])) {
628  foreach ($_POST['hint_ids'] as $hintId) {
629  if ((int) $hintId) {
630  $hintIds[] = (int) $hintId;
631  }
632  }
633  } elseif ($request->isset('hint_id') && (int) $request->raw('hint_id')) {
634  $hintIds[] = (int) $request->raw('hint_id');
635  }
636 
637  return $hintIds;
638  }
639 
647  private static function fetchHintIndexesParameter(): array
648  {
649  $hintIndexes = array();
650 
651  if (isset($_POST['hint_indexes']) && is_array($_POST['hint_indexes'])) {
652  foreach ($_POST['hint_indexes'] as $hintId => $hintIndex) {
653  if ((int) $hintId) {
654  $hintIndexes[(int) $hintId] = $hintIndex;
655  }
656  }
657  }
658 
659  return $hintIndexes;
660  }
661 
670  private static function orderHintIndexes($hintIndexes): array
671  {
672  asort($hintIndexes);
673 
674  return $hintIndexes;
675  }
676 
677  public function confirmSyncCmd(): void
678  {
679  $this->questionGUI->originalSyncForm('showHints');
680  }
681 
689  public function getHintPresentationLinkTarget($hintId, $xmlStyle = true): string
690  {
691  global $DIC;
692  $ilCtrl = $DIC['ilCtrl'];
693 
694  if ($this->questionOBJ->isAdditionalContentEditingModePageObject()) {
695  $ilCtrl->setParameterByClass('ilasshintpagegui', 'hint_id', $hintId);
696  $linkTarget = $ilCtrl->getLinkTargetByClass('ilAssHintPageGUI', '', '', false, $xmlStyle);
697  } else {
698  $ilCtrl->setParameter($this, 'hintId', $hintId);
699  $linkTarget = $ilCtrl->getLinkTarget($this, self::CMD_SHOW_HINT, '', false, $xmlStyle);
700  }
701 
702  return $linkTarget;
703  }
704 
713  private function showHintCmd(): void
714  {
715  global $DIC;
716  $ilCtrl = $DIC['ilCtrl'];
717  $tpl = $DIC['tpl'];
718  $lng = $DIC['lng'];
719 
720  if (!$this->request->isset('hintId') || !(int) $this->request->raw('hintId')) {
721  throw new ilTestException('no hint id given');
722  }
723 
724  $DIC->tabs()->clearTargets();
725  $DIC->tabs()->clearSubTabs();
726 
727  $DIC->tabs()->setBackTarget(
728  $DIC->language()->txt('tst_question_hints_back_to_hint_list'),
729  $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW_LIST)
730  );
731 
732  $questionHint = ilAssQuestionHint::getInstanceById((int) $this->request->raw('hintId'));
733 
734  // build form
735 
736  $form = new ilPropertyFormGUI();
737 
738  $form->setFormAction($ilCtrl->getFormAction($this));
739 
740  $form->setTableWidth('100%');
741 
742  $form->setTitle(sprintf(
743  $lng->txt('tst_question_hints_form_header_edit'),
744  $questionHint->getIndex(),
745  $this->questionOBJ->getTitleForHTMLOutput()
746  ));
747 
748  // form input: hint text
749 
750  $nonEditableHintText = new ilNonEditableValueGUI($lng->txt('tst_question_hints_form_label_hint_text'), 'hint_text', true);
751  $nonEditableHintText->setValue(ilLegacyFormElementsUtil::prepareTextareaOutput($questionHint->getText(), true));
752  $form->addItem($nonEditableHintText);
753 
754  // form input: hint points
755 
756  $nonEditableHintPoints = new ilNonEditableValueGUI($lng->txt('tst_question_hints_form_label_hint_points'), 'hint_points');
757  $nonEditableHintPoints->setValue($questionHint->getPoints());
758  $form->addItem($nonEditableHintPoints);
759 
760  $tpl->setContent($form->getHTML());
761  }
762 }
static getListByQuestionId($questionId)
instantiates a question hint list for the passed question id
static orderHintIndexes($hintIndexes)
sorts the array of indexes by index value so keys (hint ids) get into new order submitted by user ...
getHintPresentationLinkTarget($hintId, $xmlStyle=true)
returns the link target for hint request presentation
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ILIAS TestQuestionPool InternalRequestService $request
showListCmd()
shows a table with existing hints
showHintCmd()
shows an allready requested hint
static fetchHintIdsParameter()
fetches either an array of hint ids from POST or a single hint id from GET and returns an array of (a...
const CMD_SHOW_LIST
command constants
getQuestionHintListWithoutHintStoredInOrderingClipboard(ilAssQuestionHintList $questionHintList)
returns a new quastion hint list that contains all question hints from the passed list except for the...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(assQuestionGUI $questionGUI)
Constructor.
global $DIC
Definition: feed.php:28
resetOrderingClipboardCmd()
resets the ordering clipboard
const TBL_MODE_TESTOUTPUT
the available table modes controlling the tables behaviour
cutToOrderingClipboardCmd()
cuts a hint from question hint list and stores it to ordering clipboard
pasteFromOrderingClipboardAfterCmd()
pastes a hint from ordering clipboard after the selected one
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
confirmDeleteCmd()
shows a confirmation screen with selected hints for deletion
performDeleteCmd()
performs confirmed deletion for selected hints
const CMD_SHOW_FORM
command constants
static fetchHintIndexesParameter()
fetches an array of hint index values from POST
ilGlobalTemplateInterface $main_tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
pasteFromOrderingClipboardBeforeCmd()
pastes a hint from ordering clipboard before the selected one
addHint(ilAssQuestionHint $questionHint)
adds a question hint object to the current list instance
__construct(Container $dic, ilPlugin $plugin)
$ilUser
Definition: imgupload.php:34
saveListOrderCmd()
saves the order based on index values passed from table&#39;s form (the table must not be paginated...
static _isWriteable(int $question_id, int $user_id)
checkForSingleHintIdAndRedirectOnFailure($hintIds)
checks for a hint id in the passed array and redirects with corresponding failure message if not exac...
setEditingEnabled(bool $editingEnabled)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
initHintOrderingClipboardNotification()
inits the notification telling the user, that a hint is stored to hint ordering clipboard ...
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
checkForExistingHintRelatingToCurrentQuestionAndRedirectOnFailure($hintId)
checks for an existing hint relating to current question and redirects with corresponding failure mes...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...