ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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 ()
 
 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...
 
 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...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

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
 
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 42 of file class.ilObjSurveyQuestionPoolGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

43  {
44  global $DIC;
45 
46  $this->nav_history = $DIC["ilNavigationHistory"];
47  $this->toolbar = $DIC->toolbar();
48  $this->help = $DIC["ilHelp"];
49 
50  $this->edit_request = $DIC->surveyQuestionPool()
51  ->internal()
52  ->gui()
53  ->editing()
54  ->request();
55  $this->edit_manager = $DIC->surveyQuestionPool()
56  ->internal()
57  ->domain()
58  ->editing();
59 
60  $this->type = "spl";
61 
63  "",
64  $this->edit_request->getRefId(),
65  true,
66  false
67  );
68  $this->lng->loadLanguageModule("survey");
69  $this->ctrl->saveParameter($this, array("ref_id"));
70  $this->log = ilLoggerFactory::getLogger('svy');
71  }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ 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 904 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().

904  : void
905  {
906  global $DIC;
907  $main_tpl = $DIC->ui()->mainTemplate();
908 
909  $ctrl = $DIC->ctrl();
910  $ilAccess = $DIC->access();
911  $lng = $DIC->language();
912 
913  if ($ilAccess->checkAccess("visible", "", $a_target) ||
914  $ilAccess->checkAccess("read", "", $a_target)) {
915  $ctrl->setParameterByClass("ilObjSurveyQuestionPoolGUI", "ref_id", $a_target);
916  $ctrl->redirectByClass("ilObjSurveyQuestionPoolGUI", "infoScreen");
917  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
918  $main_tpl->setOnScreenMessage('failure', sprintf(
919  $lng->txt("msg_no_perm_read_item"),
921  ), true);
923  }
924  }
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 754 of file class.ilObjSurveyQuestionPoolGUI.php.

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

754  : void
755  {
756  $ilLocator = $this->locator;
757  switch ($this->ctrl->getCmd()) {
758  case "create":
759  case "importFile":
760  case "cancel":
761  break;
762  default:
763  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $this->edit_request->getRefId());
764  break;
765  }
766  if ($this->edit_request->getQuestionId() > 0) {
767  $q_id = $this->edit_request->getQuestionId();
768  $q_type = SurveyQuestion::_getQuestionType($q_id) . "GUI";
769  $q_title = SurveyQuestion::_getTitle($q_id);
770  if ($q_title) {
771  // not on create
772  $this->ctrl->setParameterByClass($q_type, "q_id", $q_id);
773  $ilLocator->addItem(
774  $q_title,
775  $this->ctrl->getLinkTargetByClass($q_type, "editQuestion")
776  );
777  }
778  }
779  }
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 492 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ cancelDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteExportFileObject ( )

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

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

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

◆ cancelDeleteQuestionsObject()

ilObjSurveyQuestionPoolGUI::cancelDeleteQuestionsObject ( )

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

References ILIAS\Repository\ctrl().

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

◆ confirmDeleteExportFileObject()

ilObjSurveyQuestionPoolGUI::confirmDeleteExportFileObject ( )

confirmation screen for export file deletion

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

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

569  : void
570  {
571  $files = $this->edit_request->getFiles();
572  if (count($files) === 0) {
573  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
574  $this->ctrl->redirect($this, "export");
575  }
576 
577  $this->tpl->setOnScreenMessage('question', $this->lng->txt("info_delete_sure"));
578  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true);
579  $export_dir = $this->object->getExportDirectory();
580  $data = array();
581  foreach ($files as $exp_file) {
582  $file_arr = explode("__", $exp_file);
583  $data[] = array('file' => $exp_file,
584  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
585  'size' => filesize($export_dir . "/" . $exp_file)
586  );
587  }
588  $table_gui->setData($data);
589  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
590  }
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 325 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ copyObject()

ilObjSurveyQuestionPoolGUI::copyObject ( )

Copies checked questions in the questionpool to a clipboard.

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

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

244  : void
245  {
246  $qids = $this->edit_request->getQuestionIds();
247  if (count($qids) > 0) {
248  foreach ($qids as $key => $value) {
249  $this->object->copyToClipboard($value);
250  }
251  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_insert_clipboard"), true);
252  } else {
253  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_copy_select_none"), true);
254  }
255  $this->ctrl->redirect($this, "questions");
256  }
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 688 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ deleteExportFileObject()

ilObjSurveyQuestionPoolGUI::deleteExportFileObject ( )

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

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

598  : void
599  {
600  $export_dir = $this->object->getExportDirectory();
601  $files = $this->edit_request->getFiles();
602  foreach ($files as $file) {
603  $file = basename($file);
604 
605  $exp_file = $export_dir . "/" . $file;
606  $exp_dir = $export_dir . "/" . substr($file, 0, -4);
607  if (is_file($exp_file)) {
608  unlink($exp_file);
609  }
610  if (is_dir($exp_dir)) {
611  ilFileUtils::delDir($exp_dir);
612  }
613  }
614  $this->ctrl->redirect($this, "export");
615  }
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 292 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ downloadExportFileObject()

ilObjSurveyQuestionPoolGUI::downloadExportFileObject ( )

download export file

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

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

545  : void
546  {
547  $files = $this->edit_request->getFiles();
548  if (count($files) === 0) {
549  $this->tpl->setOnScreenMessage('info', $this->lng->txt("no_checkbox"), true);
550  $this->ctrl->redirect($this, "export");
551  }
552 
553  if (count($files) > 1) {
554  $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_max_one_item"), true);
555  $this->ctrl->redirect($this, "export");
556  }
557 
558 
559  $export_dir = $this->object->getExportDirectory();
560 
561  $file = basename($files[0]);
562 
563  ilFileDelivery::deliverFileLegacy($export_dir . "/" . $file, $file);
564  }
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 73 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().

73  : void
74  {
75  $ilNavigationHistory = $this->nav_history;
76 
77  if (!$this->checkPermissionBool("visible") &&
78  !$this->checkPermissionBool("read")) {
79  $this->checkPermission("read");
80  }
81 
82  // add entry to navigation history
83  if (!$this->getCreationMode() &&
84  $this->checkPermissionBool("read")) {
85  $ilNavigationHistory->addItem(
86  $this->ref_id,
87  "ilias.php?baseClass=ilObjSurveyQuestionPoolGUI&cmd=questions&ref_id=" . $this->ref_id,
88  "spl"
89  );
90  }
91 
92  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "survey.css", "Modules/Survey"), "screen");
93  $this->prepareOutput();
94 
95  $cmd = $this->ctrl->getCmd("questions");
96  $next_class = $this->ctrl->getNextClass($this);
97  $this->ctrl->setReturn($this, "questions");
98  $q_type = "";
99  if ($this->edit_request->getQuestionId() < 1) {
100  $q_type = $this->edit_request->getSelectedQuestionTypes();
101  }
102 
103  $this->log->debug("- cmd=" . $cmd . " next_class=" . $next_class);
104  switch ($next_class) {
105  case 'ilobjectmetadatagui':
106  $this->checkPermission('write');
107  $md_gui = new ilObjectMetaDataGUI($this->object);
108  $this->ctrl->forwardCommand($md_gui);
109  break;
110 
111  case 'ilpermissiongui':
112  $perm_gui = new ilPermissionGUI($this);
113  $this->ctrl->forwardCommand($perm_gui);
114  break;
115 
116  case "ilsurveyphrasesgui":
117  $phrases_gui = new ilSurveyPhrasesGUI($this);
118  $this->ctrl->forwardCommand($phrases_gui);
119  break;
120 
121  case 'ilobjectcopygui':
122  $cp = new ilObjectCopyGUI($this);
123  $cp->setType('spl');
124  $this->ctrl->forwardCommand($cp);
125  break;
126 
127  case 'ilinfoscreengui':
128  $this->infoScreenForward();
129  break;
130 
131  case "ilcommonactiondispatchergui":
133  $this->ctrl->forwardCommand($gui);
134  break;
135 
136  case "":
137  $cmd .= "Object";
138  $this->$cmd();
139  break;
140 
141  default:
143  $q_type,
144  $this->edit_request->getQuestionId()
145  );
146  $this->log->debug("- This is the switch/case default, going to question id =" . $this->edit_request->getQuestionId());
147  $q_gui->setQuestionTabs();
148  $this->ctrl->forwardCommand($q_gui);
149 
150  // not on create
151  if ($q_gui->object->isComplete()) {
152  $this->tpl->setTitle($this->lng->txt("question") . ": " . $q_gui->object->getTitle());
153  }
154  break;
155  }
156  if (strtolower($this->edit_request->getBaseClass()) !== "iladministrationgui" &&
157  $this->getCreationMode() !== true) {
158  $this->tpl->printToStdout();
159  }
160  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
Survey phrases GUI class The ilSurveyPhrases GUI class creates the GUI output for survey phrases (col...
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 504 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().

504  : void
505  {
506  $ilToolbar = $this->toolbar;
507 
508  $ilToolbar->addButton(
509  $this->lng->txt('create_export_file'),
510  $this->ctrl->getLinkTarget($this, 'createExportFile')
511  );
512 
513  $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export');
514  $export_dir = $this->object->getExportDirectory();
515  $export_files = $this->object->getExportFiles($export_dir);
516  $data = array();
517  foreach ($export_files as $exp_file) {
518  $file_arr = explode("__", $exp_file);
519  $data[] = array('file' => $exp_file,
520  'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)),
521  'size' => filesize($export_dir . "/" . $exp_file)
522  );
523  }
524  $table_gui->setData($data);
525  $this->tpl->setContent($table_gui->getHTML());
526  }
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 278 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ filterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::filterQuestionBrowserObject ( )

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

References ILIAS\Repository\ctrl().

424  : void
425  {
426  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
427  $table_gui->writeFilterToSession();
428  $this->ctrl->redirect($this, 'questions');
429  }
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 366 of file class.ilObjSurveyQuestionPoolGUI.php.

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

Referenced by importQuestionsObject(), and uploadQuestionsObject().

367  {
368  $form = new ilPropertyFormGUI();
369  $form->setFormAction($this->ctrl->getFormAction($this, "uploadQuestions"));
370  $form->setTitle($this->lng->txt("import_question"));
371 
372  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "qtidoc");
373  $fi->setSuffixes(array("xml", "zip"));
374  $fi->setRequired(true);
375  $form->addItem($fi);
376 
377  $form->addCommandButton("uploadQuestions", $this->lng->txt("import"));
378  $form->addCommandButton("questions", $this->lng->txt("cancel"));
379  return $form;
380  }
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 781 of file class.ilObjSurveyQuestionPoolGUI.php.

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

781  : void
782  {
783  $ilHelp = $this->help;
784 
785  $ilHelp->setScreenIdComponent("spl");
786 
787  $next_class = $this->ctrl->getNextClass($this);
788  switch ($next_class) {
789  case "":
790  case "ilpermissiongui":
791  case "ilobjectmetadatagui":
792  case "ilsurveyphrasesgui":
793  break;
794  default:
795  return;
796  }
797 
798  // questions
799  $force_active = ($this->ctrl->getCmdClass() === "" &&
800  $this->ctrl->getCmd() !== "properties" && $this->ctrl->getCmd() !== "infoScreen") ||
801  ($this->ctrl->getCmd() === "" || $this->ctrl->getCmd() === null);
802  if (!$force_active) {
803  $sort = $this->edit_request->getSort();
804  if (count($sort) > 0) {
805  $force_active = true;
806  }
807  }
808 
809  if ($this->checkPermissionBool("read")) {
810  $this->tabs_gui->addTarget(
811  "survey_questions",
812  $this->ctrl->getLinkTarget($this, 'questions'),
813  array("questions", "filterQuestionBrowser", "filter", "reset", "createQuestion",
814  "importQuestions", "deleteQuestions", "copy", "paste",
815  "exportQuestions", "confirmDeleteQuestions", "cancelDeleteQuestions",
816  "confirmPasteQuestions", "cancelPasteQuestions", "uploadQuestions",
817  "editQuestion", "addMaterial", "removeMaterial", "save", "cancel",
818  "cancelExplorer", "linkChilds", "addGIT", "addST", "addPG", "preview",
819  "moveCategory", "deleteCategory", "addPhrase", "addCategory", "savePhrase",
820  "addSelectedPhrase", "cancelViewPhrase", "confirmSavePhrase", "cancelSavePhrase",
821  "insertBeforeCategory", "insertAfterCategory", "confirmDeleteCategory",
822  "cancelDeleteCategory", "categories", "saveCategories",
823  "savePhrase", "addPhrase"
824  ),
825  array("ilobjsurveyquestionpoolgui", "ilsurveyphrasesgui"),
826  "",
827  $force_active
828  );
829 
830  $this->tabs_gui->addTarget(
831  "info_short",
832  $this->ctrl->getLinkTarget($this, "infoScreen"),
833  array("infoScreen", "showSummary")
834  );
835  }
836 
837  if ($this->checkPermissionBool('write')) {
838  // properties
839  $this->tabs_gui->addTarget(
840  "settings",
841  $this->ctrl->getLinkTarget($this, 'properties'),
842  array("properties", "saveProperties"),
843  "",
844  ""
845  );
846 
847  // manage phrases
848  $this->tabs_gui->addTarget(
849  "manage_phrases",
850  $this->ctrl->getLinkTargetByClass("ilsurveyphrasesgui", "phrases"),
851  array("phrases", "deletePhrase", "confirmDeletePhrase", "cancelDeletePhrase", "editPhrase", "newPhrase", "saveEditPhrase", "phraseEditor"),
852  "ilsurveyphrasesgui",
853  ""
854  );
855 
856  // meta data
857  $mdgui = new ilObjectMetaDataGUI($this->object);
858  $mdtab = $mdgui->getTab();
859  if ($mdtab) {
860  $this->tabs_gui->addTarget(
861  "meta_data",
862  $mdtab,
863  "",
864  "ilmdeditorgui"
865  );
866  }
867 
868  // export
869  $this->tabs_gui->addTarget(
870  "export",
871  $this->ctrl->getLinkTarget($this, 'export'),
872  array("export", "createExportFile", "confirmDeleteExportFile",
873  "downloadExportFile", "cancelDeleteExportFile", "deleteExportFile"),
874  "",
875  ""
876  );
877  }
878 
879  if ($this->checkPermissionBool("edit_permission")) {
880  $this->tabs_gui->addTarget(
881  "perm_settings",
882  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
883  array("perm","info","owner"),
884  'ilpermissiongui'
885  );
886  }
887  }
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 635 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().

635  : void
636  {
637  $tpl = $this->tpl;
638 
639  if (!$parent_id) {
640  $parent_id = $this->edit_request->getRefId();
641  }
642  $new_type = $this->edit_request->getNewType();
643 
644  // create permission is already checked in createObject. This check here is done to prevent hacking attempts
645  if (!$this->checkPermissionBool("create", "", $new_type)) {
646  throw new ilPermissionException($this->lng->txt("no_create_permission"));
647  }
648 
649  $this->lng->loadLanguageModule($new_type);
650  $this->ctrl->setParameter($this, "new_type", $new_type);
651 
652  $form = $this->initImportForm($new_type);
653  if ($form->checkInput()) {
654  $newObj = new ilObjSurveyQuestionPool();
655  $newObj->setType($new_type);
656  $newObj->setTitle("dummy");
657  $newObj->create(true);
658  $this->putObjectInTree($newObj);
659 
660  $newObj->createImportDirectory();
661 
662  // copy uploaded file to import directory
663  $upload = $_FILES["importfile"];
664  $file = pathinfo($upload["name"]);
665  $full_path = $newObj->getImportDirectory() . "/" . $upload["name"];
667  $upload["tmp_name"],
668  $upload["name"],
669  $full_path
670  );
671 
672  // import qti data
673  $newObj->importObject($full_path);
674 
675  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_imported"), true);
676  ilUtil::redirect("ilias.php?ref_id=" . $newObj->getRefId() .
677  "&baseClass=ilObjSurveyQuestionPoolGUI");
678  }
679 
680  // display form to correct errors
681  $form->setValuesByPost();
682  $tpl->setContent($form->getHTML());
683  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 359 of file class.ilObjSurveyQuestionPoolGUI.php.

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

359  : void
360  {
361  $tpl = $this->tpl;
362  $form = $this->getImportForm();
363  $tpl->setContent($form->getHTML());
364  }
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 739 of file class.ilObjSurveyQuestionPoolGUI.php.

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

Referenced by executeCommand(), and infoScreenObject().

739  : void
740  {
741  if (!$this->checkPermissionBool("read")) {
742  $this->checkPermission("visible");
743  }
744 
745  $info = new ilInfoScreenGUI($this);
746  $info->enablePrivateNotes();
747 
748  // standard meta data
749  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
750 
751  $this->ctrl->forwardCommand($info);
752  }
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 729 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ initCreationForms()

ilObjSurveyQuestionPoolGUI::initCreationForms ( string  $new_type)
protected

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

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

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

◆ initEditForm()

ilObjSurveyQuestionPoolGUI::initEditForm ( )
protected

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

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

Referenced by propertiesObject(), and savePropertiesObject().

163  {
164  $obj_service = $this->object_service;
165 
166  $form = new ilPropertyFormGUI();
167  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
168  $form->setTitle($this->lng->txt("properties"));
169  $form->setMultipart(false);
170  $form->setId("properties");
171 
172  // title
173  $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
174  $title->setSubmitFormOnEnter(true);
175  $title->setValue($this->object->getTitle());
176  $title->setSize(min(40, ilObject::TITLE_LENGTH));
177  $title->setMaxLength(ilObject::TITLE_LENGTH);
178  $title->setRequired(true);
179  $form->addItem($title);
180 
181  // desc
182  $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
183  $desc->setValue($this->object->getLongDescription());
184  $desc->setRows(2);
185  $desc->setCols(40);
186  $form->addItem($desc);
187 
188  // online
189  $online = new ilCheckboxInputGUI($this->lng->txt("spl_online_property"), "online");
190  $online->setInfo($this->lng->txt("spl_online_property_description"));
191  $online->setChecked($this->object->getOnline());
192  $form->addItem($online);
193 
194  $section = new ilFormSectionHeaderGUI();
195  $section->setTitle($this->lng->txt('obj_presentation'));
196  $form->addItem($section);
197 
198  // tile image
199  $obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();
200 
201  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
202 
203  return $form;
204  }
const TITLE_LENGTH
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a checkbox property in a property form.
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 617 of file class.ilObjSurveyQuestionPoolGUI.php.

Referenced by importFileObject(), and initCreationForms().

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

◆ moveObject()

ilObjSurveyQuestionPoolGUI::moveObject ( )

mark one or more question objects for moving

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

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

261  : void
262  {
263  $qids = $this->edit_request->getQuestionIds();
264  if (count($qids) > 0) {
265  foreach ($qids as $key => $value) {
266  $this->object->moveToClipboard($value);
267  }
268  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_insert_clipboard"), true);
269  } else {
270  $this->tpl->setOnScreenMessage('info', $this->lng->txt("spl_move_select_none"), true);
271  }
272  $this->ctrl->redirect($this, "questions");
273  }
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 345 of file class.ilObjSurveyQuestionPoolGUI.php.

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

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

◆ previewObject()

ilObjSurveyQuestionPoolGUI::previewObject ( )

create preview of object

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

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

715  : void
716  {
718  "",
719  $this->edit_request->getPreview()
720  );
721  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $q_gui->getQuestionType());
722  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $this->edit_request->getPreview());
723  $this->ctrl->redirectByClass(get_class($q_gui), "preview");
724  }
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 209 of file class.ilObjSurveyQuestionPoolGUI.php.

References initEditForm().

Referenced by savePropertiesObject().

209  : void
210  {
211  if (!$a_form) {
212  $a_form = $this->initEditForm();
213  }
214 
215  $this->tpl->setVariable("ADM_CONTENT", $a_form->getHTML());
216  }
+ 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 441 of file class.ilObjSurveyQuestionPoolGUI.php.

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

Referenced by deleteQuestionsObject(), and exportQuestionObject().

441  : void
442  {
444  $ilToolbar = $this->toolbar;
445 
446  $this->object->purgeQuestions();
447 
448  if ($this->checkPermissionBool('write')) {
449  $qtypes = new ilSelectInputGUI("", "sel_question_types");
450  $qtypes->setValue($ilUser->getPref("svy_lastquestiontype"));
451  $ilToolbar->addInputItem($qtypes);
452 
453  $options = array();
454  foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data) {
455  $options[$data["type_tag"]] = $translation;
456  }
457  $qtypes->setOptions($options);
458 
459  $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
460 
461  $button = ilSubmitButton::getInstance();
462  $button->setCaption("svy_create_question");
463  $button->setCommand("createQuestion");
464  $ilToolbar->addButtonInstance($button);
465 
466  $ilToolbar->addSeparator();
467 
468  $button = ilSubmitButton::getInstance();
469  $button->setCaption("import");
470  $button->setCommand("importQuestions");
471  $ilToolbar->addButtonInstance($button);
472  }
473 
474  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions', $this->checkPermissionBool('write'));
475  $table_gui->setEditable($this->checkPermissionBool('write'));
476  $arrFilter = array();
477  foreach ($table_gui->getFilterItems() as $item) {
478  if ($item->getValue() !== false) {
479  $arrFilter[$item->getPostVar()] = $item->getValue();
480  }
481  }
482  $table_gui->setData($this->object->getQuestionsData($arrFilter));
483  $this->tpl->setContent($table_gui->getHTML());
484  }
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.
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetfilterQuestionBrowserObject()

ilObjSurveyQuestionPoolGUI::resetfilterQuestionBrowserObject ( )

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

References ILIAS\Repository\ctrl().

431  : void
432  {
433  $table_gui = new ilSurveyQuestionsTableGUI($this, 'questions');
434  $table_gui->resetFilter();
435  $this->ctrl->redirect($this, 'questions');
436  }
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 892 of file class.ilObjSurveyQuestionPoolGUI.php.

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

892  : void
893  {
894  $obligatory = $this->edit_request->getObligatory();
895  $this->object->setObligatoryStates($obligatory);
896 
897  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
898  $this->ctrl->redirect($this, "questions");
899  }
+ Here is the call graph for this function:

◆ savePropertiesObject()

ilObjSurveyQuestionPoolGUI::savePropertiesObject ( )

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

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

218  : void
219  {
220  $obj_service = $this->object_service;
221  $form = $this->initEditForm();
222  if ($form->checkInput()) {
223  $this->object->setTitle($form->getInput("title"));
224  $this->object->setDescription($form->getInput("desc"));
225  $this->object->setOnline((int) $form->getInput("online"));
226 
227  $this->object->saveToDb();
228 
229  // tile image
230  $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
231 
232  $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
233  $this->ctrl->redirect($this, "properties");
234  }
235 
236  $form->setValuesByPost();
237  $this->propertiesObject($form);
238  }
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 486 of file class.ilObjSurveyQuestionPoolGUI.php.

References ILIAS\Repository\lng().

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

◆ uploadQuestionsObject()

ilObjSurveyQuestionPoolGUI::uploadQuestionsObject ( )

imports question(s) into the questionpool

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

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

385  : void
386  {
387  $form = $this->getImportForm();
388  if ($form->checkInput()) {
389  // check if file was uploaded
390  $source = $_FILES["qtidoc"]["tmp_name"];
391  $error = 0;
392  if (($source === 'none') || (!$source) || $_FILES["qtidoc"]["error"] > UPLOAD_ERR_OK) {
393  $error = 1;
394  }
395  // check correct file type
396  if (!$error && strpos("xml", $_FILES["qtidoc"]["type"]) !== false) {
397  $error = 1;
398  }
399  if (!$error) {
400  // import file into questionpool
401  // create import directory
402  $this->object->createImportDirectory();
403 
404  // copy uploaded file to import directory
405  $full_path = $this->object->getImportDirectory() . "/" . $_FILES["qtidoc"]["name"];
406 
408  $_FILES["qtidoc"]["tmp_name"],
409  $_FILES["qtidoc"]["name"],
410  $full_path
411  );
412  $source = $full_path;
413  $this->object->importObject($source, true);
414  unlink($source);
415  }
416  $this->ctrl->redirect($this, "questions");
417  } else {
418  $form->setValuesByPost();
419  $tpl = $this->tpl;
420  $tpl->setContent($form->getHTML());
421  }
422  }
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
$source
Definition: metadata.php:93
+ Here is the call graph for this function:

Field Documentation

◆ $defaultscript

string ilObjSurveyQuestionPoolGUI::$defaultscript

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

◆ $edit_manager

ILIAS SurveyQuestionPool Editing EditManager ilObjSurveyQuestionPoolGUI::$edit_manager
protected

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

◆ $edit_request

EditingGUIRequest ilObjSurveyQuestionPoolGUI::$edit_request
protected

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

◆ $help

ilHelpGUI ilObjSurveyQuestionPoolGUI::$help
protected

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

Referenced by getTabs().

◆ $log

ilLogger ilObjSurveyQuestionPoolGUI::$log
protected

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

◆ $nav_history

ilNavigationHistory ilObjSurveyQuestionPoolGUI::$nav_history
protected

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

Referenced by executeCommand().

◆ $update

bool ilObjSurveyQuestionPoolGUI::$update
protected

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


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