ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilObjSurveyQuestionPoolGUI.php
Go to the documentation of this file.
1 <?php
2 
24 
39 {
40  protected \ILIAS\SurveyQuestionPool\InternalGUIService $gui;
41  protected \ILIAS\SurveyQuestionPool\Editing\EditManager $edit_manager;
42  protected bool $update;
45  protected ilHelpGUI $help;
46  protected ilLogger $log;
49  public string $defaultscript;
50 
51  public function __construct()
52  {
53  global $DIC;
54 
55  $this->nav_history = $DIC["ilNavigationHistory"];
56  $this->toolbar = $DIC->toolbar();
57  $this->help = $DIC["ilHelp"];
58  $this->refinery = $DIC->refinery();
59  $this->archives = $DIC->archives();
60  $this->edit_request = $DIC->surveyQuestionPool()
61  ->internal()
62  ->gui()
63  ->editing()
64  ->request();
65  $this->edit_manager = $DIC->surveyQuestionPool()
66  ->internal()
67  ->domain()
68  ->editing();
69 
70  $this->type = "spl";
71 
73  "",
74  $this->edit_request->getRefId(),
75  true,
76  false
77  );
78  $this->lng->loadLanguageModule("survey");
79  $this->ctrl->saveParameter($this, array("ref_id"));
80  $this->log = ilLoggerFactory::getLogger('svy');
81  $this->gui = $DIC->surveyQuestionPool()->internal()->gui();
82  }
83 
84  public function executeCommand(): void
85  {
86  $ilNavigationHistory = $this->nav_history;
87  if (!$this->checkPermissionBool("visible") &&
88  !$this->checkPermissionBool("read")) {
89  $this->checkPermission("read");
90  }
91 
92  // add entry to navigation history
93  if (!$this->getCreationMode() &&
94  $this->checkPermissionBool("read")) {
95  $ilNavigationHistory->addItem(
96  $this->ref_id,
97  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
98  "spl"
99  );
100  }
101 
102  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css"), "screen");
103  $this->prepareOutput();
104 
105  $cmd = $this->ctrl->getCmd("questions");
106  $next_class = $this->ctrl->getNextClass($this);
107  if ($cmd !== "cancel") {
108  $this->ctrl->setReturn($this, "questions");
109  }
110  $q_type = "";
111  if ($this->edit_request->getQuestionId() < 1) {
112  $q_type = $this->edit_request->getSelectedQuestionTypes();
113  }
114 
115  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
116  switch ($next_class) {
117  case 'ilobjectmetadatagui':
118  $this->tabs_gui->activateTab("meta_data");
119  $this->checkPermission('write');
120  $md_gui = new ilObjectMetaDataGUI($this->object);
121  $this->ctrl->forwardCommand($md_gui);
122  break;
123 
124  case 'ilpermissiongui':
125  $perm_gui = new ilPermissionGUI($this);
126  $this->ctrl->forwardCommand($perm_gui);
127  break;
128 
129  case 'ilobjectcopygui':
130  $cp = new ilObjectCopyGUI($this);
131  $cp->setType('spl');
132  $this->ctrl->forwardCommand($cp);
133  break;
134 
135  case 'ilinfoscreengui':
136  $this->tabs_gui->activateTab("info_short");
137  $this->infoScreenForward();
138  break;
139 
140  case "ilcommonactiondispatchergui":
142  $this->ctrl->forwardCommand($gui);
143  break;
144 
145  case strtolower(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class):
146  $this->checkPermission("write");
147  $this->tabs_gui->activateTab("settings");
148  $gui = $this->gui->settings()->settingsGUI(
149  $this->object->getId(),
150  $this->object->getRefId()
151  );
152  $this->ctrl->forwardCommand($gui);
153  break;
154 
155  case strtolower(ilExportGUI::class):
156  $export = new ilExportGUI($this, $this->object);
157  $this->ctrl->forwardCommand($export);
158  break;
159 
160  case "":
161  $cmd .= "Object";
162  $this->$cmd();
163  break;
164 
165  default:
167  $q_type,
168  $this->edit_request->getQuestionId()
169  );
170  $this->log->debug("- This is the switch/case default, going to question id =" . $this->edit_request->getQuestionId());
171  $q_gui->setQuestionTabs();
172  $this->ctrl->forwardCommand($q_gui);
173 
174  // not on create
175  if ($q_gui->object->isComplete()) {
176  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
177  }
178  break;
179  }
180  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
181  $this->getCreationMode() !== true) {
182  $this->tpl->printToStdout();
183  }
184  }
185 
189  public function propertiesObject(?ilPropertyFormGUI $a_form = null): void
190  {
191  $this->ctrl->redirectByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class);
192  }
193 
194 
198  public function copyObject(): void
199  {
200  $qids = $this->edit_request->getQuestionIds();
201  if (count($qids) > 0) {
202  foreach ($qids as $key => $value) {
203  $this->object->copyToClipboard($value);
204  }
205  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_insert_clipboard"), true);
206  } else {
207  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_select_none"), true);
208  }
209  $this->ctrl->redirect($this, "questions");
210  }
211 
215  public function moveObject(): void
216  {
217  $qids = $this->edit_request->getQuestionIds();
218  if (count($qids) > 0) {
219  foreach ($qids as $key => $value) {
220  $this->object->moveToClipboard($value);
221  }
222  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_insert_clipboard"), true);
223  } else {
224  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_select_none"), true);
225  }
226  $this->ctrl->redirect($this, "questions");
227  }
228 
232  public function exportQuestionObject(): void
233  {
234  $qids = $this->edit_request->getQuestionIds();
235  if (count($qids) > 0) {
236  $this->createExportFileObject($qids);
237  } else {
238  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_export_select_none"));
239  $this->questionsObject();
240  }
241  }
242 
243  public function exportQuestionExportTabObject(): void
244  {
245  $qids = $this->http->wrapper()->query()->retrieve(
246  "qid",
247  $this->refinery->custom()->transformation(function (string $value) {
248  $value = urldecode($value);
249  return explode(',', $value);
250  })
251  );
252  $this->createExportFileObject($qids);
253  }
254 
258  public function deleteQuestionsObject(): void
259  {
260  $this->checkPermission('write');
261 
262  // create an array of all checked checkboxes
263  $checked_questions = $this->edit_request->getQuestionIds();
264  if (count($checked_questions) === 0) {
265  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_delete_select_none"));
266  $this->questionsObject();
267  return;
268  }
269 
270  $cgui = new ilConfirmationGUI();
271  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
272 
273  $cgui->setFormAction($this->ctrl->getFormAction($this));
274  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
275  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
276 
277  $infos = $this->object->getQuestionInfos($checked_questions);
278  foreach ($infos as $data) {
279  $txt = $data["title"] . " (" .
280  SurveyQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
281  if ($data["description"]) {
282  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
283  }
284 
285  $cgui->addItem("q_id[]", $data["id"], $txt);
286  }
287 
288  $this->tpl->setContent($cgui->getHTML());
289  }
290 
291  public function confirmDeleteQuestionsObject(): void
292  {
293  // delete questions after confirmation
294  $this->tpl->setOnScreenMessage('success', $this->lng->txt("qpl_questions_deleted"), true);
295  $qids = $this->edit_request->getQuestionIds();
296  foreach ($qids as $q_id) {
297  $this->object->removeQuestion($q_id);
298  }
299  $this->ctrl->redirect($this, "questions");
300  }
301 
302  public function cancelDeleteQuestionsObject(): void
303  {
304  // delete questions after confirmation
305  $this->ctrl->redirect($this, "questions");
306  }
307 
311  public function pasteObject(): void
312  {
313  $clip_questions = $this->edit_manager->getQuestionsFromClipboard();
314  if (count($clip_questions) > 0) {
315  $this->object->pasteFromClipboard();
316  } else {
317  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_paste_no_objects"), true);
318  }
319  $this->ctrl->redirect($this, "questions");
320  }
321 
325  public function importQuestionsObject(): void
326  {
327  $tpl = $this->tpl;
328  $form = $this->getImportForm();
329  $tpl->setContent($form->getHTML());
330  }
331 
332  public function getImportForm(): ilPropertyFormGUI
333  {
334  $form = new ilPropertyFormGUI();
335  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
336  $form->setTitle($this->lng->txt("import_question"));
337 
338  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
339  $fi->setSuffixes(array("xml", "zip"));
340  $fi->setRequired(true);
341  $form->addItem($fi);
342 
343  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
344  $form->addCommandButton("questions", $this->lng->txt("cancel"));
345  return $form;
346  }
347 
351  public function uploadQuestionsObject(): void
352  {
353  $form = $this->getImportForm();
354  if ($form->checkInput()) {
355  // check if file was uploaded
356  $source = $_FILES["qtidoc"]["tmp_name"];
357  $error = 0;
358  if (($source === 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
359  $error = 1;
360  }
361  // check correct file type
362  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
363  $error = 1;
364  }
365  if (!$error) {
366  // import file into questionpool
367  // create import directory
368  $this->object->createImportDirectory();
369 
370  // copy uploaded file to import directory
371  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
372 
374  $_FILES["qtidoc"]["tmp_name"],
375  $_FILES["qtidoc"]["name"],
376  $full_path
377  );
378  $source = $full_path;
379  $this->object->importObject($source, true);
380  unlink($source);
381  }
382  $this->ctrl->redirect($this, "questions");
383  } else {
384  $form->setValuesByPost();
385  $tpl = $this->tpl;
386  $tpl->setContent($form->getHTML());
387  }
388  }
389 
390  public function filterQuestionBrowserObject(): void
391  {
392  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
393  $table_gui->writeFilterToSession();
394  $this->ctrl->redirect($this, 'questions');
395  }
396 
397  public function resetfilterQuestionBrowserObject(): void
398  {
399  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
400  $table_gui->resetFilter();
401  $this->ctrl->redirect($this, 'questions');
402  }
403 
407  public function questionsObject(): void
408  {
409  $this->tabs_gui->activateTab("survey_questions");
410  $ilUser = $this->user;
411  $ilToolbar = $this->toolbar;
412 
413  $this->object->purgeQuestions();
414 
415  if ($this->checkPermissionBool('write')) {
416  $qtypes = new ilSelectInputGUI("", "sel_question_types");
417  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
418  $ilToolbar->addInputItem($qtypes);
419 
420  $options = array();
421  foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data) {
422  $options[$data["type_tag"]] = $translation;
423  }
424  $qtypes->setOptions($options);
425 
426  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
427 
428  $this->gui->button(
429  $this->lng->txt("svy_create_question"),
430  "createQuestion"
431  )->submit()->toToolbar();
432 
433  $ilToolbar->addSeparator();
434  /*
435  $this->gui->button(
436  $this->lng->txt("import"),
437  "importQuestions"
438  )->submit()->toToolbar();
439  */
440  }
441 
442  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $this->checkPermissionBool('write'));
443  $table_gui->setEditable($this->checkPermissionBool('write'));
444  $arrFilter = array();
445  foreach ($table_gui->getFilterItems() as $item) {
446  if ($item->getValue() !== false) {
447  $arrFilter[$item->getPostVar()] = $item->getValue();
448  }
449  }
450  $table_gui->setData($this->object->getQuestionsData($arrFilter));
451  $this->tpl->setContent($table_gui->getHTML());
452  }
453 
454  public function updateObject(): void
455  {
456  $this->update = $this->object->update();
457  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
458  }
459 
460  protected function afterSave(ilObject $new_object): void
461  {
462  // always send a message
463  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
464 
465  ilUtil::redirect("ilias.php?ref_id=" . $new_object->getRefId() .
466  "&baseClass=ilObjSurveyQuestionPoolGUI");
467  }
468 
472  public function exportObject(): void
473  {
474  $export = new ilExportGUI($this, $this->object);
475  $export->listExportFiles();
476  }
477 
481  public function createExportFileObject($questions = null): void
482  {
483  $this->checkPermission("write");
484 
486  $svy = $this->object;
487  $survey_exp = new ilSurveyQuestionpoolExport($svy);
488  $survey_exp->buildExportFile($questions);
489  $this->ctrl->redirect($this, "export");
490  }
491 
495  public function downloadExportFileObject(): void
496  {
497  $files = $this->edit_request->getFiles();
498  if (count($files) === 0) {
499  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
500  $this->ctrl->redirect($this, "export");
501  }
502 
503  if (count($files) > 1) {
504  $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_max_one_item"), true);
505  $this->ctrl->redirect($this, "export");
506  }
507 
508 
509  $export_dir = $this->object->getExportDirectory();
510 
511  $file = basename($files[0]);
512 
513  ilFileDelivery::deliverFileLegacy($export_dir . "/" . $file, $file);
514  }
515 
519  public function confirmDeleteExportFileObject(): void
520  {
521  $files = $this->edit_request->getFiles();
522  if (count($files) === 0) {
523  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
524  $this->ctrl->redirect($this, "export");
525  }
526 
527  $this->tpl->setOnScreenMessage('question', $this->lng->txt("info_delete_sure"));
528  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
529  $export_dir = $this->object->getExportDirectory();
530  $data = array();
531  foreach ($files as $exp_file) {
532  $file_arr = explode("__", $exp_file);
533  $data[] = array('file' => $exp_file,
534  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
535  'size' => filesize($export_dir . "/" . $exp_file)
536  );
537  }
538  $table_gui->setData($data);
539  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
540  }
541 
542  public function cancelDeleteExportFileObject(): void
543  {
544  ilSession::clear("ilExportFiles");
545  $this->ctrl->redirect($this, "export");
546  }
547 
548  public function deleteExportFileObject(): void
549  {
550  $export_dir = $this->object->getExportDirectory();
551  $files = $this->edit_request->getFiles();
552  foreach ($files as $file) {
553  $file = basename($file);
554 
555  $exp_file = $export_dir . "/" . $file;
556  $exp_dir = $export_dir . "/" . substr($file, 0, -4);
557  if (is_file($exp_file)) {
558  unlink($exp_file);
559  }
560  if (is_dir($exp_dir)) {
561  ilFileUtils::delDir($exp_dir);
562  }
563  }
564  $this->ctrl->redirect($this, "export");
565  }
566 
570  public function createQuestionObject(): void
571  {
572  $ilUser = $this->user;
573 
574  $ilUser->writePref(
575  "svy_lastquestiontype",
576  $this->edit_request->getSelectedQuestionTypes()
577  );
578 
580  $this->edit_request->getSelectedQuestionTypes()
581  );
582  $q_gui->object->setObjId($this->object->getId());
583  $q_gui->object->createNewQuestion();
584 
585  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
586  $this->ctrl->setParameterByClass(
587  get_class($q_gui),
588  "sel_question_types",
589  $this->edit_request->getSelectedQuestionTypes()
590  );
591  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
592  }
593 
597  public function previewObject(): void
598  {
600  "",
601  $this->edit_request->getPreview()
602  );
603  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
604  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $this->edit_request->getPreview());
605  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
606  }
607 
611  public function infoScreenObject(): void
612  {
613  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
614  }
615 
619  public function infoScreenForward(): void
620  {
621  if (!$this->checkPermissionBool("read")) {
622  $this->checkPermission("visible");
623  }
624 
625  $info = new ilInfoScreenGUI($this);
626  $info->enablePrivateNotes();
627 
628  // standard meta data
629  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
630 
631  $this->ctrl->forwardCommand($info);
632  }
633 
634  protected function importFile(string $file_to_import, string $path_to_uploaded_file_in_temp_dir): void
635  {
636  $unzip = $this->archives->unzip(Streams::ofResource(fopen($file_to_import, 'r')));
637  # If export contains a manifest xml use standard import
638  if (in_array(basename($file_to_import, ".zip") . DIRECTORY_SEPARATOR . "manifest.xml", iterator_to_array($unzip->getFiles()))) {
639  parent::importFile($file_to_import, $path_to_uploaded_file_in_temp_dir);
640  return;
641  }
642  $tpl = $this->tpl;
643 
644  $newObj = new ilObjSurveyQuestionPool();
645  $newObj->setTitle("dummy");
646  $newObj->create();
647  $this->putObjectInTree($newObj);
648 
649  // import qti data
650  $newObj->importObject($file_to_import);
651 
652  if ($path_to_uploaded_file_in_temp_dir !== ''
653  && $this->temp_file_system->hasDir($path_to_uploaded_file_in_temp_dir)) {
654  $this->temp_file_system->deleteDir($path_to_uploaded_file_in_temp_dir);
655  }
656 
657  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
658  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
659  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
660  "&baseClass=ilObjSurveyQuestionPoolGUI");
661  }
662 
663  protected function addLocatorItems(): void
664  {
665  $ilLocator = $this->locator;
666  switch ($this->ctrl->getCmd()) {
667  case "create":
668  case "importFile":
669  case "cancel":
670  break;
671  default:
672  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->edit_request->getRefId());
673  break;
674  }
675  if ($this->edit_request->getQuestionId() > 0) {
676  $q_id = $this->edit_request->getQuestionId();
677  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
678  $q_title = SurveyQuestion::_getTitle($q_id);
679  if ($q_title) {
680  // not on create
681  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
682  $ilLocator->addItem(
683  $q_title,
684  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
685  );
686  }
687  }
688  }
689 
690  protected function getTabs(): void
691  {
692  $ilHelp = $this->help;
693  $ilHelp->setScreenIdComponent("spl");
694 
695  if ($this->checkPermissionBool("read")) {
696  $this->tabs_gui->addTab(
697  "survey_questions",
698  $this->lng->txt("survey_questions"),
699  $this->ctrl->getLinkTarget($this, 'questions')
700  );
701 
702  $this->tabs_gui->addTab(
703  "info_short",
704  $this->lng->txt("info_short"),
705  $this->ctrl->getLinkTarget($this, "infoScreen")
706  );
707  }
708 
709  if ($this->checkPermissionBool('write')) {
710  $this->tabs_gui->addTab(
711  "settings",
712  $this->lng->txt("settings"),
713  $this->ctrl->getLinkTargetByClass(\ILIAS\SurveyQuestionPool\Settings\SettingsGUI::class)
714  );
715 
716  // meta data
717  $mdgui = new ilObjectMetaDataGUI($this->object);
718  $mdtab = $mdgui->getTab();
719  if ($mdtab) {
720  $this->tabs_gui->addTab(
721  "meta_data",
722  $this->lng->txt("meta_data"),
723  $mdtab
724  );
725  }
726 
727  // export
728  $this->tabs_gui->addTab(
729  "export",
730  $this->lng->txt("export"),
731  $this->ctrl->getLinkTarget($this, 'export')
732  );
733  }
734 
735  if ($this->checkPermissionBool("edit_permission")) {
736  $this->tabs_gui->addTab(
737  "perm_settings",
738  $this->lng->txt("perm_settings"),
739  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
740  );
741  }
742  }
743 
747  public function saveObligatoryObject(): void
748  {
749  $obligatory = $this->edit_request->getObligatory();
750  $this->object->setObligatoryStates($obligatory);
751 
752  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
753  $this->ctrl->redirect($this, "questions");
754  }
755 
759  public static function _goto(string $a_target): void
760  {
761  global $DIC;
762  $main_tpl = $DIC->ui()->mainTemplate();
763 
764  $ctrl = $DIC->ctrl();
765  $ilAccess = $DIC->access();
766  $lng = $DIC->language();
767 
768  if ($ilAccess->checkAccess("visible", "", $a_target) ||
769  $ilAccess->checkAccess("read", "", $a_target)) {
770  $ctrl->setParameterByClass("ilObjSurveyQuestionPoolGUI", "ref_id", $a_target);
771  $ctrl->redirectByClass("ilObjSurveyQuestionPoolGUI", "infoScreen");
772  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
773  $main_tpl->setOnScreenMessage('failure', sprintf(
774  $lng->txt("msg_no_perm_read_item"),
776  ), true);
778  }
779  }
780 }
Class ilObjSurveyQuestionPoolGUI.
importQuestionsObject()
display the import form to import questions into the question pool
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
Class ilObjectMetaDataGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
writePref(string $a_keyword, string $a_value)
This class represents a selection list property in a property form.
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...
Class ilObjSurveyQuestionPool.
confirmDeleteExportFileObject()
confirmation screen for export file deletion
GUI class for the workflow of copying objects.
const ROOT_FOLDER_ID
Definition: constants.php:32
ILIAS SurveyQuestionPool InternalGUIService $gui
copyObject()
Copies checked questions in the questionpool to a clipboard.
prepareOutput(bool $show_sub_objects=true)
This class represents a file property in a property form.
Interface Observer Contains several chained tasks and infos about them.
Help GUI class.
saveObligatoryObject()
Save obligatory states.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
propertiesObject(?ilPropertyFormGUI $a_form=null)
Edit question pool properties.
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
static _goto(string $a_target)
Redirect script to call a survey question pool reference id.
static _getQuestionType(int $question_id)
Returns the question type of a question with a given id.
setSuffixes(array $a_suffixes)
static _getTitle(int $question_id)
Returns the question title of a question with a given id.
ILIAS SurveyQuestionPool Editing EditManager $edit_manager
const IL_CAL_UNIX
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
static _lookupObjId(int $ref_id)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
ilLanguage $lng
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
importFile(string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
static http()
Fetches the global http state from ILIAS.
infoScreenObject()
this one is called from the info button in the repository
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectGUI Basic methods of all Output classes.
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
global $DIC
Definition: shib_login.php:26
ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
$txt
Definition: error.php:31
Last visited history for repository items.
ilErrorHandling $error
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
deleteQuestionsObject()
Creates a confirmation form to delete questions from the question pool.
__construct(Container $dic, ilPlugin $plugin)
static _getQuestiontypes()
Get all available question types.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
uploadQuestionsObject()
imports question(s) into the questionpool
questionsObject()
list questions of question pool
$info
Definition: entry_point.php:21
moveObject()
mark one or more question objects for moving
ilLocatorGUI $locator
static clear(string $a_var)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
pasteObject()
paste questions from the clipboard into the question pool
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.