ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjSurveyQuestionPoolGUI Class Reference

Class ilObjSurveyQuestionPoolGUI. More...

+ Inheritance diagram for ilObjSurveyQuestionPoolGUI:
+ Collaboration diagram for ilObjSurveyQuestionPoolGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 propertiesObject (ilPropertyFormGUI $a_form=null)
 Edit question pool properties. More...
 
 savePropertiesObject ()
 
 copyObject ()
 Copies checked questions in the questionpool to a clipboard. More...
 
 moveObject ()
 mark one or more question objects for moving More...
 
 exportQuestionObject ()
 export a question More...
 
 deleteQuestionsObject ()
 Creates a confirmation form to delete questions from the question pool. More...
 
 confirmDeleteQuestionsObject ()
 
 cancelDeleteQuestionsObject ()
 
 pasteObject ()
 paste questions from the clipboard into the question pool More...
 
 importQuestionsObject ()
 display the import form to import questions into the question pool More...
 
 getImportForm ()
 
 uploadQuestionsObject ()
 imports question(s) into the questionpool More...
 
 filterQuestionBrowserObject ()
 
 resetfilterQuestionBrowserObject ()
 
 questionsObject ()
 list questions of question pool More...
 
 updateObject ()
 
 exportObject ()
 list all export files More...
 
 downloadExportFileObject ()
 download export file More...
 
 confirmDeleteExportFileObject ()
 confirmation screen for export file deletion More...
 
 cancelDeleteExportFileObject ()
 
 deleteExportFileObject ()
 
 createQuestionObject ()
 create new question More...
 
 previewObject ()
 create preview of object More...
 
 infoScreenObject ()
 this one is called from the info button in the repository More...
 
 infoScreenForward ()
 show information screen More...
 
 saveObligatoryObject ()
 Save obligatory states. More...
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 Redirect script to call a survey question pool reference id. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

string $defaultscript
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initEditForm ()
 
 afterSave (ilObject $new_object)
 
 initImportForm (string $new_type)
 
 initCreationForms (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 addLocatorItems ()
 
 getTabs ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 

Protected Attributes

ILIAS Survey InternalGUIService $gui
 
ILIAS SurveyQuestionPool Editing EditManager $edit_manager
 
bool $update
 
EditingGUIRequest $edit_request
 
ilNavigationHistory $nav_history
 
ilHelpGUI $help
 
ilLogger $log
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSurveyQuestionPoolGUI::__construct ( )

Definition at line 43 of file class.ilObjSurveyQuestionPoolGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

44  {
45  global $DIC;
46 
47  $this->nav_history = $DIC["ilNavigationHistory"];
48  $this->toolbar = $DIC->toolbar();
49  $this->help = $DIC["ilHelp"];
50 
51  $this->edit_request = $DIC->surveyQuestionPool()
52  ->internal()
53  ->gui()
54  ->editing()
55  ->request();
56  $this->edit_manager = $DIC->surveyQuestionPool()
57  ->internal()
58  ->domain()
59  ->editing();
60 
61  $this->type = "spl";
62 
64  "",
65  $this->edit_request->getRefId(),
66  true,
67  false
68  );
69  $this->lng->loadLanguageModule("survey");
70  $this->ctrl->saveParameter($this, array("ref_id"));
71  $this->log = ilLoggerFactory::getLogger('svy');
72  $this->gui = $DIC->survey()->internal()->gui();
73  }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSurveyQuestionPoolGUI::_goto ( string  $a_target)
static

Redirect script to call a survey question pool reference id.

Definition at line 890 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

890  : void
891  {
892  global $DIC;
893  $main_tpl = $DIC->ui()->mainTemplate();
894 
895  $ctrl = $DIC->ctrl();
896  $ilAccess = $DIC->access();
897  $lng = $DIC->language();
898 
899  if ($ilAccess->checkAccess("visible", "", $a_target) ||
900  $ilAccess->checkAccess("read", "", $a_target)) {
901  $ctrl->setParameterByClass("ilObjSurveyQuestionPoolGUI", "ref_id", $a_target);
902  $ctrl->redirectByClass("ilObjSurveyQuestionPoolGUI", "infoScreen");
903  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
904  $main_tpl->setOnScreenMessage('failure', sprintf(
905  $lng->txt("msg_no_perm_read_item"),
907  ), true);
909  }
910  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
ilLanguage $lng
static _lookupTitle(int $obj_id)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSurveyQuestionPoolGUI::addLocatorItems ( )
protected

Definition at line 752 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$locator, SurveyQuestion\_getQuestionType(), SurveyQuestion\_getTitle(), ilLocatorGUI\addItem(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

752  : void
753  {
754  $ilLocator = $this->locator;
755  switch ($this->ctrl->getCmd()) {
756  case "create":
757  case "importFile":
758  case "cancel":
759  break;
760  default:
761  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->edit_request->getRefId());
762  break;
763  }
764  if ($this->edit_request->getQuestionId() > 0) {
765  $q_id = $this->edit_request->getQuestionId();
766  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
767  $q_title = SurveyQuestion::_getTitle($q_id);
768  if ($q_title) {
769  // not on create
770  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
771  $ilLocator->addItem(
772  $q_title,
773  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
774  );
775  }
776  }
777  }
static _getQuestionType(int $question_id)
Returns the question type of a question with a given id.
static _getTitle(int $question_id)
Returns the question title of a question with a given id.
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjSurveyQuestionPoolGUI::afterSave ( ilObject  $new_object)
protected

Definition at line 490 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObject\getRefId(), ILIAS\Repository\lng(), and ilUtil\redirect().

490  : void
491  {
492  // always send a message
493  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
494 
495  ilUtil::redirect("ilias.php?ref_id=" . $new_object->getRefId() .
496  "&baseClass=ilObjSurveyQuestionPoolGUI");
497  }
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

Definition at line 590 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilSession\clear(), and ILIAS\Repository\ctrl().

590  : void
591  {
592  ilSession::clear("ilExportFiles");
593  $this->ctrl->redirect($this, "export");
594  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

Definition at line 334 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

334  : void
335  {
336  // delete questions after confirmation
337  $this->ctrl->redirect($this, "questions");
338  }
+ Here is the call graph for this function:

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

Definition at line 567 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_UNIX, and ILIAS\Repository\lng().

567  : void
568  {
569  $files = $this->edit_request->getFiles();
570  if (count($files) === 0) {
571  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
572  $this->ctrl->redirect($this, "export");
573  }
574 
575  $this->tpl->setOnScreenMessage('question', $this->lng->txt("info_delete_sure"));
576  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
577  $export_dir = $this->object->getExportDirectory();
578  $data = array();
579  foreach ($files as $exp_file) {
580  $file_arr = explode("__", $exp_file);
581  $data[] = array('file' => $exp_file,
582  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
583  'size' => filesize($export_dir . "/" . $exp_file)
584  );
585  }
586  $table_gui->setData($data);
587  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
588  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
+ Here is the call graph for this function:

◆ confirmDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteQuestionsObject ( )

Definition at line 323 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

323  : void
324  {
325  // delete questions after confirmation
326  $this->tpl->setOnScreenMessage('success', $this->lng->txt("qpl_questions_deleted"), true);
327  $qids = $this->edit_request->getQuestionIds();
328  foreach ($qids as $q_id) {
329  $this->object->removeQuestion($q_id);
330  }
331  $this->ctrl->redirect($this, "questions");
332  }
+ Here is the call graph for this function:

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

Definition at line 242 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

242  : void
243  {
244  $qids = $this->edit_request->getQuestionIds();
245  if (count($qids) > 0) {
246  foreach ($qids as $key => $value) {
247  $this->object->copyToClipboard($value);
248  }
249  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_insert_clipboard"), true);
250  } else {
251  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_select_none"), true);
252  }
253  $this->ctrl->redirect($this, "questions");
254  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ createQuestionObject()

ilObjSurveyQuestionPoolGUI::createQuestionObject ( )

create new question

Definition at line 686 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$user, SurveyQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ILIAS\Repository\object(), and ilObjUser\writePref().

686  : void
687  {
688  $ilUser = $this->user;
689 
690  $ilUser->writePref(
691  "svy_lastquestiontype",
692  $this->edit_request->getSelectedQuestionTypes()
693  );
694 
696  $this->edit_request->getSelectedQuestionTypes()
697  );
698  $q_gui->object->setObjId($this->object->getId());
699  $q_gui->object->createNewQuestion();
700 
701  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
702  $this->ctrl->setParameterByClass(
703  get_class($q_gui),
704  "sel_question_types",
705  $this->edit_request->getSelectedQuestionTypes()
706  );
707  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
708  }
writePref(string $a_keyword, string $a_value)
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

Definition at line 596 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and ilFileUtils\delDir().

596  : void
597  {
598  $export_dir = $this->object->getExportDirectory();
599  $files = $this->edit_request->getFiles();
600  foreach ($files as $file) {
601  $file = basename($file);
602 
603  $exp_file = $export_dir . "/" . $file;
604  $exp_dir = $export_dir . "/" . substr($file, 0, -4);
605  if (is_file($exp_file)) {
606  unlink($exp_file);
607  }
608  if (is_dir($exp_dir)) {
609  ilFileUtils::delDir($exp_dir);
610  }
611  }
612  $this->ctrl->redirect($this, "export");
613  }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ deleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::deleteQuestionsObject ( )

Creates a confirmation form to delete questions from the question pool.

Definition at line 290 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, $txt, SurveyQuestion\_getQuestionTypeName(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and questionsObject().

290  : void
291  {
292  $this->checkPermission('write');
293 
294  // create an array of all checked checkboxes
295  $checked_questions = $this->edit_request->getQuestionIds();
296  if (count($checked_questions) === 0) {
297  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_delete_select_none"));
298  $this->questionsObject();
299  return;
300  }
301 
302  $cgui = new ilConfirmationGUI();
303  $cgui->setHeaderText($this->lng->txt("qpl_confirm_delete_questions"));
304 
305  $cgui->setFormAction($this->ctrl->getFormAction($this));
306  $cgui->setCancel($this->lng->txt("cancel"), "cancelDeleteQuestions");
307  $cgui->setConfirm($this->lng->txt("confirm"), "confirmDeleteQuestions");
308 
309  $infos = $this->object->getQuestionInfos($checked_questions);
310  foreach ($infos as $data) {
311  $txt = $data["title"] . " (" .
312  SurveyQuestion::_getQuestionTypeName($data["type_tag"]) . ")";
313  if ($data["description"]) {
314  $txt .= "<div class=\"small\">" . $data["description"] . "</div>";
315  }
316 
317  $cgui->addItem("q_id[]", $data["id"], $txt);
318  }
319 
320  $this->tpl->setContent($cgui->getHTML());
321  }
static _getQuestionTypeName(string $type_tag)
Return the translation for a given question type.
$txt
Definition: error.php:14
questionsObject()
list questions of question pool
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

Definition at line 543 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), ilFileDelivery\deliverFileLegacy(), and ILIAS\Repository\lng().

543  : void
544  {
545  $files = $this->edit_request->getFiles();
546  if (count($files) === 0) {
547  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
548  $this->ctrl->redirect($this, "export");
549  }
550 
551  if (count($files) > 1) {
552  $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_max_one_item"), true);
553  $this->ctrl->redirect($this, "export");
554  }
555 
556 
557  $export_dir = $this->object->getExportDirectory();
558 
559  $file = basename($files[0]);
560 
561  ilFileDelivery::deliverFileLegacy($export_dir . "/" . $file, $file);
562  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjSurveyQuestionPoolGUI::executeCommand ( )

Definition at line 75 of file class.ilObjSurveyQuestionPoolGUI.php.

References $nav_history, SurveyQuestionGUI\_getQuestionGUI(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilUtil\getStyleSheetLocation(), infoScreenForward(), ILIAS\Repository\lng(), and ilObjectGUI\prepareOutput().

75  : void
76  {
77  $ilNavigationHistory = $this->nav_history;
78  if (!$this->checkPermissionBool("visible") &&
79  !$this->checkPermissionBool("read")) {
80  $this->checkPermission("read");
81  }
82 
83  // add entry to navigation history
84  if (!$this->getCreationMode() &&
85  $this->checkPermissionBool("read")) {
86  $ilNavigationHistory->addItem(
87  $this->ref_id,
88  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
89  "spl"
90  );
91  }
92 
93  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
94  $this->prepareOutput();
95 
96  $cmd = $this->ctrl->getCmd("questions");
97  $next_class = $this->ctrl->getNextClass($this);
98  if ($cmd !== "cancel") {
99  $this->ctrl->setReturn($this, "questions");
100  }
101  $q_type = "";
102  if ($this->edit_request->getQuestionId() < 1) {
103  $q_type = $this->edit_request->getSelectedQuestionTypes();
104  }
105 
106  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
107  switch ($next_class) {
108  case 'ilobjectmetadatagui':
109  $this->checkPermission('write');
110  $md_gui = new ilObjectMetaDataGUI($this->object);
111  $this->ctrl->forwardCommand($md_gui);
112  break;
113 
114  case 'ilpermissiongui':
115  $perm_gui = new ilPermissionGUI($this);
116  $this->ctrl->forwardCommand($perm_gui);
117  break;
118 
119  case 'ilobjectcopygui':
120  $cp = new ilObjectCopyGUI($this);
121  $cp->setType('spl');
122  $this->ctrl->forwardCommand($cp);
123  break;
124 
125  case 'ilinfoscreengui':
126  $this->infoScreenForward();
127  break;
128 
129  case "ilcommonactiondispatchergui":
131  $this->ctrl->forwardCommand($gui);
132  break;
133 
134  case "":
135  $cmd .= "Object";
136  $this->$cmd();
137  break;
138 
139  default:
141  $q_type,
142  $this->edit_request->getQuestionId()
143  );
144  $this->log->debug("- This is the switch/case default, going to question id =" . $this->edit_request->getQuestionId());
145  $q_gui->setQuestionTabs();
146  $this->ctrl->forwardCommand($q_gui);
147 
148  // not on create
149  if ($q_gui->object->isComplete()) {
150  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
151  }
152  break;
153  }
154  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
155  $this->getCreationMode() !== true) {
156  $this->tpl->printToStdout();
157  }
158  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Survey InternalGUIService $gui
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
static getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ exportObject()

ilObjSurveyQuestionPoolGUI::exportObject ( )

list all export files

Definition at line 502 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$object, ilObjectGUI\$toolbar, ilToolbarGUI\addButton(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_UNIX, and ILIAS\Repository\lng().

502  : void
503  {
504  $ilToolbar = $this->toolbar;
505 
506  $ilToolbar->addButton(
507  $this->lng->txt('create_export_file'),
508  $this->ctrl->getLinkTarget($this, 'createExportFile')
509  );
510 
511  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
512  $export_dir = $this->object->getExportDirectory();
513  $export_files = $this->object->getExportFiles($export_dir);
514  $data = array();
515  foreach ($export_files as $exp_file) {
516  $file_arr = explode("__", $exp_file);
517  $data[] = array('file' => $exp_file,
518  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
519  'size' => filesize($export_dir . "/" . $exp_file)
520  );
521  }
522  $table_gui->setData($data);
523  $this->tpl->setContent($table_gui->getHTML());
524  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
ilToolbarGUI $toolbar
+ Here is the call graph for this function:

◆ exportQuestionObject()

ilObjSurveyQuestionPoolGUI::exportQuestionObject ( )

export a question

Definition at line 276 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\lng(), and questionsObject().

276  : void
277  {
278  $qids = $this->edit_request->getQuestionIds();
279  if (count($qids) > 0) {
280  $this->createExportFileObject($qids);
281  } else {
282  $this->tpl->setOnScreenMessage('info', $this->lng->txt("qpl_export_select_none"));
283  $this->questionsObject();
284  }
285  }
questionsObject()
list questions of question pool
+ Here is the call graph for this function:

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

Definition at line 422 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

422  : void
423  {
424  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
425  $table_gui->writeFilterToSession();
426  $this->ctrl->redirect($this, 'questions');
427  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getImportForm()

ilObjSurveyQuestionPoolGUI::getImportForm ( )

Definition at line 364 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilFileInputGUI\setSuffixes().

Referenced by importQuestionsObject(), and uploadQuestionsObject().

365  {
366  $form = new ilPropertyFormGUI();
367  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
368  $form->setTitle($this->lng->txt("import_question"));
369 
370  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
371  $fi->setSuffixes(array("xml", "zip"));
372  $fi->setRequired(true);
373  $form->addItem($fi);
374 
375  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
376  $form->addCommandButton("questions", $this->lng->txt("cancel"));
377  return $form;
378  }
This class represents a file property in a property form.
setSuffixes(array $a_suffixes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTabs()

ilObjSurveyQuestionPoolGUI::getTabs ( )
protected

Definition at line 779 of file class.ilObjSurveyQuestionPoolGUI.php.

References $help, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ilHelpGUI\setScreenIdComponent().

779  : void
780  {
781  $ilHelp = $this->help;
782 
783  $ilHelp->setScreenIdComponent("spl");
784 
785  $next_class = $this->ctrl->getNextClass($this);
786  switch ($next_class) {
787  case "":
788  case "ilpermissiongui":
789  case "ilobjectmetadatagui":
790  break;
791  default:
792  return;
793  }
794 
795  // questions
796  $force_active = ($this->ctrl->getCmdClass() === "" &&
797  $this->ctrl->getCmd() !== "properties" && $this->ctrl->getCmd() !== "infoScreen") ||
798  ($this->ctrl->getCmd() === "" || $this->ctrl->getCmd() === null);
799  if (!$force_active) {
800  $sort = $this->edit_request->getSort();
801  if (count($sort) > 0) {
802  $force_active = true;
803  }
804  }
805 
806  if ($this->checkPermissionBool("read")) {
807  $this->tabs_gui->addTarget(
808  "survey_questions",
809  $this->ctrl->getLinkTarget($this, 'questions'),
810  array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
811  "importQuestions", "deleteQuestions", "copy", "paste",
812  "exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
813  "confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
814  "editQuestion", "save", "cancel",
815  "cancelExplorer", "linkChilds", "preview",
816  "moveCategory", "deleteCategory", "addCategory",
817  "insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
818  "cancelDeleteCategory", "categories", "saveCategories"
819  ),
820  array("ilobjsurveyquestionpoolgui"),
821  "",
822  $force_active
823  );
824 
825  $this->tabs_gui->addTarget(
826  "info_short",
827  $this->ctrl->getLinkTarget($this, "infoScreen"),
828  array("infoScreen", "showSummary")
829  );
830  }
831 
832  if ($this->checkPermissionBool('write')) {
833  // properties
834  $this->tabs_gui->addTarget(
835  "settings",
836  $this->ctrl->getLinkTarget($this, 'properties'),
837  array("properties", "saveProperties"),
838  "",
839  ""
840  );
841 
842  // meta data
843  $mdgui = new ilObjectMetaDataGUI($this->object);
844  $mdtab = $mdgui->getTab();
845  if ($mdtab) {
846  $this->tabs_gui->addTarget(
847  "meta_data",
848  $mdtab,
849  "",
850  "ilmdeditorgui"
851  );
852  }
853 
854  // export
855  $this->tabs_gui->addTarget(
856  "export",
857  $this->ctrl->getLinkTarget($this, 'export'),
858  array("export", "createExportFile", "confirmDeleteExportFile",
859  "downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
860  "",
861  ""
862  );
863  }
864 
865  if ($this->checkPermissionBool("edit_permission")) {
866  $this->tabs_gui->addTarget(
867  "perm_settings",
868  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
869  array("perm","info","owner"),
870  'ilpermissiongui'
871  );
872  }
873  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setScreenIdComponent(string $a_comp)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ importFileObject()

ilObjSurveyQuestionPoolGUI::importFileObject ( int  $parent_id = null)
protected

Definition at line 633 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), initImportForm(), ILIAS\Repository\lng(), ilFileUtils\moveUploadedFile(), ilObjectGUI\putObjectInTree(), ilUtil\redirect(), and ilGlobalTemplateInterface\setContent().

633  : void
634  {
635  $tpl = $this->tpl;
636 
637  if (!$parent_id) {
638  $parent_id = $this->edit_request->getRefId();
639  }
640  $new_type = $this->edit_request->getNewType();
641 
642  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
643  if (!$this->checkPermissionBool("create", "", $new_type)) {
644  throw new ilPermissionException($this->lng->txt("no_create_permission"));
645  }
646 
647  $this->lng->loadLanguageModule($new_type);
648  $this->ctrl->setParameter($this, "new_type", $new_type);
649 
650  $form = $this->initImportForm($new_type);
651  if ($form->checkInput()) {
652  $newObj = new ilObjSurveyQuestionPool();
653  $newObj->setType($new_type);
654  $newObj->setTitle("dummy");
655  $newObj->create(true);
656  $this->putObjectInTree($newObj);
657 
658  $newObj->createImportDirectory();
659 
660  // copy uploaded file to import directory
661  $upload = $_FILES["importfile"];
662  $file = pathinfo($upload["name"]);
663  $full_path = $newObj->getImportDirectory() . "/" . $upload["name"];
665  $upload["tmp_name"],
666  $upload["name"],
667  $full_path
668  );
669 
670  // import qti data
671  $newObj->importObject($full_path);
672 
673  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
674  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
675  "&baseClass=ilObjSurveyQuestionPoolGUI");
676  }
677 
678  // display form to correct errors
679  $form->setValuesByPost();
680  $tpl->setContent($form->getHTML());
681  }
Class ilObjSurveyQuestionPool.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
+ Here is the call graph for this function:

◆ importQuestionsObject()

ilObjSurveyQuestionPoolGUI::importQuestionsObject ( )

display the import form to import questions into the question pool

Definition at line 357 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$tpl, getImportForm(), and ilGlobalTemplateInterface\setContent().

357  : void
358  {
359  $tpl = $this->tpl;
360  $form = $this->getImportForm();
361  $tpl->setContent($form->getHTML());
362  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSurveyQuestionPoolGUI::infoScreenForward ( )

show information screen

Definition at line 737 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand(), and infoScreenObject().

737  : void
738  {
739  if (!$this->checkPermissionBool("read")) {
740  $this->checkPermission("visible");
741  }
742 
743  $info = new ilInfoScreenGUI($this);
744  $info->enablePrivateNotes();
745 
746  // standard meta data
747  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
748 
749  $this->ctrl->forwardCommand($info);
750  }
Class ilInfoScreenGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjSurveyQuestionPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository

Definition at line 727 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and infoScreenForward().

727  : void
728  {
729  $this->ctrl->setCmd("showSummary");
730  $this->ctrl->setCmdClass("ilinfoscreengui");
731  $this->infoScreenForward();
732  }
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms ( string  $new_type)
protected

Definition at line 623 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\initCreateForm(), and initImportForm().

623  : array
624  {
625  $form = $this->initImportForm($new_type);
626 
627  $forms = array(self::CFORM_NEW => $this->initCreateForm($new_type),
628  self::CFORM_IMPORT => $form);
629 
630  return $forms;
631  }
initCreateForm(string $new_type)
+ Here is the call graph for this function:

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

Definition at line 160 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$object_service, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilTextAreaInputGUI\setValue(), and ilObject\TITLE_LENGTH.

Referenced by propertiesObject(), and savePropertiesObject().

161  {
162  $obj_service = $this->object_service;
163 
164  $form = new ilPropertyFormGUI();
165  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
166  $form->setTitle($this->lng->txt("properties"));
167  $form->setMultipart(false);
168  $form->setId("properties");
169 
170  // title
171  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
172  $title->setSubmitFormOnEnter(true);
173  $title->setValue($this->object->getTitle());
174  $title->setSize(min(40, ilObject::TITLE_LENGTH));
175  $title->setMaxLength(ilObject::TITLE_LENGTH);
176  $title->setRequired(true);
177  $form->addItem($title);
178 
179  // desc
180  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
181  $desc->setValue($this->object->getLongDescription());
182  $desc->setRows(2);
183  $desc->setCols(40);
184  $form->addItem($desc);
185 
186  // online
187  $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
188  $online->setInfo($this->lng->txt("spl_online_property_description"));
189  $online->setChecked($this->object->getOnline());
190  $form->addItem($online);
191 
192  $section = new ilFormSectionHeaderGUI();
193  $section->setTitle($this->lng->txt('obj_presentation'));
194  $form->addItem($section);
195 
196  // tile image
197  $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
198 
199  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
200 
201  return $form;
202  }
const TITLE_LENGTH
ilObjectService $object_service
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initImportForm()

ilObjSurveyQuestionPoolGUI::initImportForm ( string  $new_type)
protected

Definition at line 615 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by importFileObject(), and initCreationForms().

616  {
617  $form = parent::initImportForm($new_type);
618  $form->getItemByPostVar('importfile')->setSuffixes(array("zip", "xml"));
619 
620  return $form;
621  }
+ Here is the caller graph for this function:

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

Definition at line 259 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

259  : void
260  {
261  $qids = $this->edit_request->getQuestionIds();
262  if (count($qids) > 0) {
263  foreach ($qids as $key => $value) {
264  $this->object->moveToClipboard($value);
265  }
266  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_insert_clipboard"), true);
267  } else {
268  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_select_none"), true);
269  }
270  $this->ctrl->redirect($this, "questions");
271  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ pasteObject()

ilObjSurveyQuestionPoolGUI::pasteObject ( )

paste questions from the clipboard into the question pool

Definition at line 343 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

343  : void
344  {
345  $clip_questions = $this->edit_manager->getQuestionsFromClipboard();
346  if (count($clip_questions) > 0) {
347  $this->object->pasteFromClipboard();
348  } else {
349  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_paste_no_objects"), true);
350  }
351  $this->ctrl->redirect($this, "questions");
352  }
+ Here is the call graph for this function:

◆ previewObject()

ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

Definition at line 713 of file class.ilObjSurveyQuestionPoolGUI.php.

References SurveyQuestionGUI\_getQuestionGUI(), and ILIAS\Repository\ctrl().

713  : void
714  {
716  "",
717  $this->edit_request->getPreview()
718  );
719  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
720  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $this->edit_request->getPreview());
721  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
722  }
static _getQuestionGUI(?string $questiontype, int $question_id=-1)
Creates a question gui representation.
+ Here is the call graph for this function:

◆ propertiesObject()

ilObjSurveyQuestionPoolGUI::propertiesObject ( ilPropertyFormGUI  $a_form = null)

Edit question pool properties.

Definition at line 207 of file class.ilObjSurveyQuestionPoolGUI.php.

References initEditForm().

Referenced by savePropertiesObject().

207  : void
208  {
209  if (!$a_form) {
210  $a_form = $this->initEditForm();
211  }
212 
213  $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
214  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ questionsObject()

ilObjSurveyQuestionPoolGUI::questionsObject ( )

list questions of question pool

Definition at line 439 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$data, ilObjectGUI\$toolbar, ilObjectGUI\$user, ilObjSurveyQuestionPool\_getQuestiontypes(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by deleteQuestionsObject(), and exportQuestionObject().

439  : void
440  {
441  $ilUser = $this->user;
442  $ilToolbar = $this->toolbar;
443 
444  $this->object->purgeQuestions();
445 
446  if ($this->checkPermissionBool('write')) {
447  $qtypes = new ilSelectInputGUI("", "sel_question_types");
448  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
449  $ilToolbar->addInputItem($qtypes);
450 
451  $options = array();
452  foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data) {
453  $options[$data["type_tag"]] = $translation;
454  }
455  $qtypes->setOptions($options);
456 
457  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
458 
459  $this->gui->button(
460  $this->lng->txt("svy_create_question"),
461  "createQuestion"
462  )->submit()->toToolbar();
463 
464  $ilToolbar->addSeparator();
465 
466  $this->gui->button(
467  $this->lng->txt("import"),
468  "importQuestions"
469  )->submit()->toToolbar();
470  }
471 
472  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $this->checkPermissionBool('write'));
473  $table_gui->setEditable($this->checkPermissionBool('write'));
474  $arrFilter = array();
475  foreach ($table_gui->getFilterItems() as $item) {
476  if ($item->getValue() !== false) {
477  $arrFilter[$item->getPostVar()] = $item->getValue();
478  }
479  }
480  $table_gui->setData($this->object->getQuestionsData($arrFilter));
481  $this->tpl->setContent($table_gui->getHTML());
482  }
This class represents a selection list property in a property form.
ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _getQuestiontypes()
Get all available question types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

Definition at line 429 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl().

429  : void
430  {
431  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
432  $table_gui->resetFilter();
433  $this->ctrl->redirect($this, 'questions');
434  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveObligatoryObject()

ilObjSurveyQuestionPoolGUI::saveObligatoryObject ( )

Save obligatory states.

Definition at line 878 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

878  : void
879  {
880  $obligatory = $this->edit_request->getObligatory();
881  $this->object->setObligatoryStates($obligatory);
882 
883  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
884  $this->ctrl->redirect($this, "questions");
885  }
+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

Definition at line 216 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$object_service, ILIAS\Repository\ctrl(), initEditForm(), ILIAS\Repository\lng(), and propertiesObject().

216  : void
217  {
218  $obj_service = $this->object_service;
219  $form = $this->initEditForm();
220  if ($form->checkInput()) {
221  $this->object->setTitle($form->getInput("title"));
222  $this->object->setDescription($form->getInput("desc"));
223  $this->object->setOnline((int) $form->getInput("online"));
224 
225  $this->object->saveToDb();
226 
227  // tile image
228  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
229 
230  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
231  $this->ctrl->redirect($this, "properties");
232  }
233 
234  $form->setValuesByPost();
235  $this->propertiesObject($form);
236  }
ilObjectService $object_service
propertiesObject(ilPropertyFormGUI $a_form=null)
Edit question pool properties.
+ Here is the call graph for this function:

◆ updateObject()

ilObjSurveyQuestionPoolGUI::updateObject ( )

Definition at line 484 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\lng().

484  : void
485  {
486  $this->update = $this->object->update();
487  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
488  }
+ Here is the call graph for this function:

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

Definition at line 383 of file class.ilObjSurveyQuestionPoolGUI.php.

References ilObjectGUI\$error, ilObjectGUI\$tpl, ILIAS\Repository\ctrl(), getImportForm(), ilFileUtils\moveUploadedFile(), and ilGlobalTemplateInterface\setContent().

383  : void
384  {
385  $form = $this->getImportForm();
386  if ($form->checkInput()) {
387  // check if file was uploaded
388  $source = $_FILES["qtidoc"]["tmp_name"];
389  $error = 0;
390  if (($source === 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
391  $error = 1;
392  }
393  // check correct file type
394  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
395  $error = 1;
396  }
397  if (!$error) {
398  // import file into questionpool
399  // create import directory
400  $this->object->createImportDirectory();
401 
402  // copy uploaded file to import directory
403  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
404 
406  $_FILES["qtidoc"]["tmp_name"],
407  $_FILES["qtidoc"]["name"],
408  $full_path
409  );
410  $source = $full_path;
411  $this->object->importObject($source, true);
412  unlink($source);
413  }
414  $this->ctrl->redirect($this, "questions");
415  } else {
416  $form->setValuesByPost();
417  $tpl = $this->tpl;
418  $tpl->setContent($form->getHTML());
419  }
420  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
ilErrorHandling $error
+ Here is the call graph for this function:

Field Documentation

◆ $defaultscript

string ilObjSurveyQuestionPoolGUI::$defaultscript

Definition at line 41 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $edit_manager

ILIAS SurveyQuestionPool Editing EditManager ilObjSurveyQuestionPoolGUI::$edit_manager
protected

Definition at line 35 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $edit_request

EditingGUIRequest ilObjSurveyQuestionPoolGUI::$edit_request
protected

Definition at line 37 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $gui

ILIAS Survey InternalGUIService ilObjSurveyQuestionPoolGUI::$gui
protected

Definition at line 34 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $help

ilHelpGUI ilObjSurveyQuestionPoolGUI::$help
protected

Definition at line 39 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by getTabs().

◆ $log

ilLogger ilObjSurveyQuestionPoolGUI::$log
protected

Definition at line 40 of file class.ilObjSurveyQuestionPoolGUI.php.

◆ $nav_history

ilNavigationHistory ilObjSurveyQuestionPoolGUI::$nav_history
protected

Definition at line 38 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by executeCommand().

◆ $update

bool ilObjSurveyQuestionPoolGUI::$update
protected

Definition at line 36 of file class.ilObjSurveyQuestionPoolGUI.php.


The documentation for this class was generated from the following file: