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